[Top] [All Lists]

Re: Coldfusion Multiplication Error

Subject: Re: Coldfusion Multiplication Error
From: "Mr Black"
Date: Wed, 9 Apr 2008 15:57:33 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
As I said already there is nothing wrong with CF or Java.  This is perfectly 
normal.  Your solution is (assuming that you are working with percentages):

 <!--- Calculate --->
 <cfset percent=number*100>
 <!--- Round to one decimal after floating point --->
 <cfset percent=NumberFormat(percent, "99.9">
 <!--- Truncate --->
 <cfset percent=Int(percent)>

 Or all together:

 <cfset percent=Int(NumberFormat(number*100, "99.9"))>

<Prev in Thread] Current Thread [Next in Thread>