On 4/30/02, Hatton Humphrey penned:
>Here's the problem:  I recently added a summary report to a financial
>calculation page.  The page has been using
>NumberFormat(tot_tot+misc_tot,"9-$999,999,999.99") for several years
>(the application has been in live use since around 1998).  The report
>that I built is using DollarFormat instead.  I was told that several of
>the totals are coming up fine in a few cases, off by a penny in most
>cases and off by two pennies in more than a few cases as well.
>
>First of all, am I correct in thinking that this is a display issue?
>Also, which one is more accurate?

I think they pretty much work the same. The main thing you need to do 
is make sure you aren't calculating on a rounded number. You can't 
calculate on DollarFormat or NumberFormat with a dollar sign as it 
will return an error, so the problem may be in the tot_tot or 
misc_tot being calculated on DecimalFormat elsewhere.

For instance.
<cfset tot_tot = 1.022>

<cfset num1 = tot_tot * 10> returns 10.22 correctly.
<cfset num2 = DecimalFormat(tot_tot) * 10> returns 10.20, which is 
off by 2 cents.
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to