Alan, Try adding an attribute of precision="2" to your @CALC tag.
Bill Alan Wolfe wrote: > Hi Everyone! > > I am having a little issue with some math and was hopeing someone > could help me out. > > Here is an example of the problem I'm having, if you run this code: > > <@calc expr="3000.00-2907.80"> > > it gives an answer of: > > 92.1999999999998 > > which is pretty close to accurate - im assuming the problem is the > same problem as when you store floating point numbers in a computer, > it is only accurate to so many decimal places. > > my problem comes in when i do this to display the results as currency: > > <@calc expr="3000.00-2907.80" format="num:3-*,\,,2,.,,,-,"> > > it gives an answer of: > > 92.19 > > which is off by one penny. > > Anyone know how to make it correctly display 92.20? > > Thanks! > Alan > ________________________________________________________________________ > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
