If you use numberFormat() without a mask, it rounds to the nearest integer
(which I think is silly). If you use decimalFormat() or dollarFormat(), it
rounds to two decimal places. The standard way of rounding a 5 is to round
it up. If you want it to round down, you could do this:

int(num*100)/100


-----Original Message-----
From: Rey Bango [mailto:[EMAIL PROTECTED] 
Sent: Monday, 18 July 2005 9:17 a.m.
To: CF-Talk
Subject: Number formatting issue

Guys,

I have a number that looks like this. 22.995

But everytime I use DollarFormat() or NumberFormat, it rounds it up to 
23.00. I need the value to display as 22.99 not 23.00. How do I get 
around this? I could just treat the value as a string and cut off the 
trailing "5" but why are the number formatting functions rounding my 
value up?

This is on CF 5.

Rey...

-- 
http://www.ReyBango.com




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212084
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to