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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding Problem

Status
Not open for further replies.

kcmark

Technical User
Nov 2, 2002
63
US
I have a query that performs several calculations on various fields. I need the query to be able to round to 2 decimal place AND truncate all numbers after 2 decimal places. I am using the Round function and it is correctly rounding the number to where I want. When this number is displayed in a form it is being displayed correctly as a rounded number. However when I click on a text box in the form that includes this rounded number it still shows multiple decimal places (ie: instead of $1.50 it will show $1.4999999998). I am dealing with currency so I have to have exact numbers or I will be chasing rounding differences all over the place. Any ideas?
 
kcmark
Is the format of the control in your form set to Currency?

If it is, your Round function should work.

Tom
 
I very much suspect Tom is correct.

In the older days, we would have to...

strNum = Format(MyAmount, "#0.00")
curNum = CSng(strNum)

Yuck and yuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top