Hey,

Can someone confirm this seemingly odd behavior? If I execute the following
code:

<cfscript>

total = 0;
numberList = "62355.57,-62355.57,-333.01,261.09,17.98,35.96,17.98";
for (i = 1;i lte listLen(numberList);i = i + 1)
{
    writeOutput("#total# + #ListGetAt(numberList,i)# = ");
    total = total + ListGetAt(numberList,i);
    writeOutput("#total#<br>");

}
writeOutput('numberFormat(total,"999,999,999.99") = ' &
numberFormat(total,"999,999,999.99"));
</cfscript>

I get the following output:

0 + 62355.57 = 62355.57
62355.57 + -62355.57 = 0
0 + -333.01 = -333.01
-333.01 + 261.09 = -71.92
-71.92 + 17.98 = -53.94
-53.94 + 35.96 = -17.98
-17.98 + 17.98 = -1.06581410364E-014
numberFormat(total,"999,999,999.99") = -0.00

I've tried using javacasts to make sure that there wasn't some odd string to
number conversion thing going on too and still got the same result. Any
ideas?

-- 
Howard Fore, [EMAIL PROTECTED]
"Whether you believe you can do a thing or not, you are right." -- Henry
Ford



-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to