Copy link to clipboard
Copied
Hi All,
What is the max decimal numbers in CF8?
Tks
Johnny
Copy link to clipboard
Copied
CF uses java.lang.Doubles for its floating point numbers:
http://download.oracle.com/javase/6/docs/api/java/lang/Double.html
--
Adam
Copy link to clipboard
Copied
Thanks for you reply and help Adam.
Rgds
Johnny
Copy link to clipboard
Copied
Note that there is a precisionEvaluate function that internally uses BigDecimal.
Copy link to clipboard
Copied
Maybe that's why my 15 digit long decimal is cutting to 12?
Thanks for you reply.
Johnny
Copy link to clipboard
Copied
jfb00 wrote:
Maybe that's why my 15 digit long decimal is cutting to 12?
Just 12? Is your 15 digit decimal perhaps being truncated by some other process? Restriction by a function or by the display field? Database field length? the following displays 20 decimals (in CF9.0.1 at least):
<cfset x = 0.12345678901234567890>
<cfoutput>#x#</cfoutput>
Copy link to clipboard
Copied
Hello,
Yes, something else was truncating my decimals.
Thanks all for your help.
Rgds
Johnny
Copy link to clipboard
Copied
CF also has a method called PrecisionEvaluate that uses Java's BigDecimal. So for higher precision requirement, it is a handy function.
Check http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fd9.html