House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Thousand Separator ONLY

Author:
Jason Fisher
06/26/2012 05:45 PM

Did you try numberFormat(myNum, ",9.9") ? On 6/27/2012 1:34 PM, Richard White wrote: > I think i may need to be clearer on what i am trying to achieve: > > I have any form of number, they could be integer or floats and with varying decimal places such as: > > 11 > 11111.111111111 > 11.11 > 1.1 > 111111111111111111111.11111111111111111111 > > etc.... > > I need to have a function that simply adds the thousand separators and returns exactly how they were, such as: > > 11 > 11,111.111111111 > 11.11 > 1.1 > 111,111,111,111,111,111,111.11111111111111111111 > > i was hoping there was an existing function that would handle this but its looking like i am going to have to develop a custom function that handles this as the number either handles integers OR floats but not both? > > thanks > > > > > >> Then try >> >> numberFormat(myNum, ",9.9") >> >> thanks Jason, although this strips off all the decimals >> >>> numberFormat(myNum, ",9") >>> >>> thanks for your help Robert although that didnt work as it returns lots of >>> zeros after the decimal place. >>> >>> for example: 112221.111 got changed to 112,221.11100000000000 >>> >>> thanks >>> >>> com/austin_ > >


Search cf-talk

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference