Coldfusion 10 NumberFormat bug

108 views Asked by At

can someone please explain why total_a and total_b show different results after NumberFormat is applied? Very unpredictable behavior.

<cfset total_a = 60.50 />
<cfset total_a = total_a*1.19 />
<cfoutput>#total_a# before round up<br /></cfoutput><!--- 71.995 --->
<cfset total_a = NumberFormat(total_a,'9.99') />
<cfoutput>#total_a# after round up<br /><br /></cfoutput><!--- 71.99 --->

<cfset total_b = 71.995 />
<cfoutput>#total_b# before round up<br /></cfoutput><!--- 71.995 --->
<cfset total_b = NumberFormat(total_b,'9.99') />
<cfoutput>#total_b# after round up<br /></cfoutput><!--- 72.00 --->
0

There are 0 answers