Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF8 max decimal number?

Advisor ,
Aug 27, 2010 Aug 27, 2010

Hi All,

What is the max decimal numbers in CF8?

Tks

Johnny

920
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 27, 2010 Aug 27, 2010

CF uses java.lang.Doubles for its floating point numbers:

http://download.oracle.com/javase/6/docs/api/java/lang/Double.html

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 27, 2010 Aug 27, 2010

Thanks for you reply and help Adam.

Rgds

Johnny

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Aug 27, 2010 Aug 27, 2010

Note that there is a precisionEvaluate function that internally uses BigDecimal.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 27, 2010 Aug 27, 2010

Maybe that's why my 15 digit long decimal is cutting to 12?

Thanks for you reply.

Johnny

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 27, 2010 Aug 27, 2010

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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 31, 2010 Aug 31, 2010

Hello,

Yes, something else was truncating my decimals.

Thanks all for your help.

Rgds

Johnny

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Aug 31, 2010 Aug 31, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources