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!

FormatCurrency quirks

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
Example:
var1 = 231.98
var2 = 2
var3 = FormatCurrency((var1/var2),2)

var3 will be $116.00, which is wrong....it should be $115.99. Am I missing something?
 
I figured it out:

I think it has something to do with the fact that the variables in question here were in a two dimensional array. The following would always return a rounded value:
var1(x,y) = var2(x,y)/var3(x,y)
BUT, the following returns exact values:
temp1 = var2(x,y)
temp2 = var3(x,y)
var1 = temp1/temp2

Why is this?
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top