Hey Jason, yes tried it but it adds a decimal to numbers that were previously
integers, or with numbers that have 5 decimals for example it rounds it to one
decimal
Did you try
numberFormat(myNum, ,9.9)
?
On 6/27/2012 1:34 PM, Richard White wrote:
Thanks Claude that works perfect, muchos gracious!
Try this:
(Note that for the last one you will get 0s at the end of the integer
part, this is probably because of an overflow error. If you really
have such large numbers, a function that works exclusively on the
string will be needed.)
Hi,
is there any way to take any integer or float and add thousand separators
without having to specify or change the decimal places
thanks
~|
Order the Adobe Coldfusion Anthology now!
PM
To: cf-talk
Subject: Thousand Separator ONLY
Hi,
is there any way to take any integer or float and add thousand separators
without having to specify or change the decimal places
thanks
~|
Order the Adobe Coldfusion
To: cf-talk
Subject: Thousand Separator ONLY
Hi,
is there any way to take any integer or float and add thousand
separators without having to specify or change the decimal places
thanks
~|
Order the Adobe Coldfusion
I believe you do your own format mask? I don't know the length of your number,
but I think NumberFormat(myvar,__,___.__) would work to
cover most any number you throw at it.
Robert Harrison
Director of Interactive Services
Austin Williams
Advertising I Branding I
Kinda thought that's what the DecimalFormat function was all about.
-Chris
Hi,
is there any way to take any integer or float and add thousand
separators without having to specify or change the decimal places
thanks
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.111000
thanks
I believe you do your own format mask? I don't know the length of
your number, but I think
Kinda thought that's what the DecimalFormat function was all about.
But now I am reminded that the DecimalFormat function always returns the two
decimal places, in addition to the thousands separators. So, I would just run
that result through a REReplace and be done with it:
cfset
numberFormat(myNum, ,9)
From: Richard White rich...@re-base.net
Sent: Tuesday, June 26, 2012 12:59 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: Thousand Separator ONLY
thanks for your help Robert although that didnt work as it returns lots
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.111000
thanks
com/austin_
thanks Chris, i get an error when using the regular expression that says the
number 112221.111 cannot be converted to a number
this looks to be an interesting challenge for all of us! :)
Kinda thought that's what the DecimalFormat function was all about.
But now I am reminded that the
Then try
numberFormat(myNum, ,9.9)
From: Richard White rich...@re-base.net
Sent: Tuesday, June 26, 2012 1:15 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: Thousand Separator ONLY
thanks Jason, although this strips off all the decimals
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
1.1
11.11
1.1
1.
etc
I need to have a function that simply adds the
Try this:
(Note that for the last one you will get 0s at the end of the integer part,
this is probably because of an overflow error. If you really have such large
numbers, a function that works exclusively on the string will be needed.)
CFSCRIPT
function thSepar(n)
{
var integerPart =
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
1.1
11.11
1.1
16 matches
Mail list logo