Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation fields

Status
Not open for further replies.

Viv1

Programmer
Dec 9, 2003
42
GB
Hi,

I have a form which contains the fields SUBSCRIPTIONS, VAT and TOTAL_BALANCE. The VAT field is worked out using the value in the SUBSCRIPTIONS field and the total of the 2 is shown in TOTAL_BALANCE. The problem is that the VAT is more often than not using 3 digits after the decimal point e.g. £12.325. This is shown as £12.33, however when calculations are made using the data they show figures such as -0.05 or -0.01. Is there anyway to set the database to use only 2 digits after the decimal place? I have tried setting the Decimal Places property to '2' but this behaves in the same way as Auto. Any suggestions welcome!

Thanks, Viv
 
Hi Viv

Use the Round function ...

TOTAL_BALANCE=[SUBSCRIPTIONS] + Round([SUBSCRIPTIONS]*0.175,2)

Hope this helps

Mac
 
I would advise against using the round function. It users bankers rounding to round the number, and as such can cause problems if you are looking at distinct numbers instead of a group.

I would use:

(int((X*100)+0.5))/100

as it produces a consistant result.

If at first you don't succeed, try for the answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top