Hello,
Is there a number formatting function that will show a maximum of two
decimal places when a remainder exists and no decimal places if it
doesn't exist? Right now I'm using numberformat and it's showing two
decimal places when there is no remainder. I'd just like for those cases
to show up
You can use...
cfset myNumber = round(myNumber * 100)/100
To get you desired formatting.
--
Jay
-Original Message-
From: Peterson, Andrew S. [mailto:[EMAIL PROTECTED]
Sent: 24 November 2004 15:20
To: CF-Talk
Subject: Easy NumberFormat Question
Hello,
Is there a number
Sierra Bufe submitted this udf to cflib.org:
function RoundIt(num,digits) {
var i = num;
// multiply by 10 to the power of the number of digits to be
preserved
i = i * (10 ^ digits);
// round off to an integer
i = Round(i);
// divide by 10 to the
Thanks guys. I checked cflib but missed this.
Sincerely,
Andrew
-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 24, 2004 10:24 AM
To: CF-Talk
Subject: Re: Easy NumberFormat Question
Sierra Bufe submitted this udf to cflib.org:
function
Thanks guys. I checked cflib but missed this.
Sincerely,
Andrew
Welcome. It was something I'd seen in the code recently at my 9-5 job,
otherwise I likely wouldn't have been able to offer the suggestion. :)
s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?
add features
Hi,
I cant figure out how to use numberformat to surround negative numbers with
brackets. Well, I can, but if I do, it appears that I also have to
incorporate the _ or the 9 for place settings, which I do not care for. Any
ideas? If there isn't one out there, I will try to roll my own.
Thanks,
, July 31, 2002 9:40 AM
Subject: Another NumberFormat question - brackets for negative numbers
Hi,
I cant figure out how to use numberformat to surround negative numbers
with
brackets. Well, I can, but if I do, it appears that I also have to
incorporate the _ or the 9 for place settings, which I
I have a situation where I need to display a price with either 2, 3 or 4
digits after the decimal place. The database is storing the information
properly, but I need to format the display to "trim" the output.
For example, I have three prices for four items:
Item 1 has a price of 45.9
Item 2
can't you output like this:
$#numberformat(number,mask)#
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 11:36 AM
To: CF-Talk
Subject: Numberformat question.
I have a situation where I need to display a price with either 2, 3 or 4
eartland Communications Group, Inc.
-Original Message-
From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 10:36 AM
To: CF-Talk
Subject: Numberformat question.
I have a situation where I need to display a price with either 2, 3 or 4
digits after the decima
hat I need is $45.90, $9.99, $2.985 and $0.4585.
Hatton
-Original Message-
From: Tumy, Brad [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 12:27 PM
To: CF-Talk
Subject: RE: Numberformat question.
can't you output like this:
$#numberformat(number,mask)#
-Original Message-
!
Hatton
-Original Message-
From: Larry Juncker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 1:44 PM
To: CF-Talk
Subject: RE: Numberformat question.
This isn't pretty, however it does work.
CFIF Len(ListLast(Item,".")) EQ 1
#NumberF
This isn't pretty, however it does work.
CFIF Len(ListLast(Item,".")) EQ 1
#NumberFormat(Item, "$999,999.9")#
CFELSEIF Len(ListLast(Item,".")) EQ 2
#NumberFormat(Item, "$999,999.99")#
CFELSEIF Len(ListLast(Item,".")) EQ 3
: RE: Numberformat question.
I've been playing with a few different masks, but anytime I set up a decimal
mask it's forcing all the places, so for example, if I have the mask set at
",9$99.", the numbers get formatted (using the examples I cited
originally) $45.9000, $9.990
PROTECTED]]
Sent: Thursday, April 05, 2001 12:44 PM
To: CF-Talk
Subject: RE: Numberformat question.
This isn't pretty, however it does work.
CFIF Len(ListLast(Item,".")) EQ 1
#NumberFormat(Item, "$999,999.9")#
CFELSEIF Len(List
a little smarter. ;)
Truman
-Original Message-
From: Larry Juncker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 2:15 PM
To: CF-Talk
Subject: RE: Numberformat question.
Hatton;
The code below will do exactly as you ask. Only on the first if statement
where I have the mask as .9
Anyone know why I would get a value of 0 in an input text
field when I do this against a numeric column which has a
null in the database?
input type="text" name="testval" value="#NumberFormat("#varname#")"
ColdFusion doesn't recognize null as a value, so it converts it to an empty
string.
Hi,
Anyone know why I would get a value of 0 in an input text field when I do
this against a numeric column which has a null in the database?
input type="text" name="testval" value="#NumberFormat("#varname#")"
Chris
--
Chris
oldFusion Discussion List
Subject: NumberFormat question
Hi,
Anyone know why I would get a value of 0 in an input text field when I do
this against a numeric column which has a null in the database?
input type="text" name="testval" va
19 matches
Mail list logo