<cfscript>
function maskit(myNum) {
var aNum = myNum / 100;
var newNum = numberFormat(aNum,".00");
return (replace(newNum,"0.",".");
}
</cfscript>
Then in your code, #maskit(7)#
Strangely, on my computer, numberFormat(aNum,".00") will STILL put a leading
zero on the number -- that's what the "replace" is for in the "return"
-----Original Message-----
From: J E VanOver [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 12:59 PM
To: CF-Talk
Subject: RE: numberformat
It DOESN'T go into the mask. Do the math, then mask the results.
-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 12:43 PM
To: CF-Talk
Subject: RE: numberformat
Thanks. How do I incorporate the / 100 into the mask. I'm new to this and
am getting errors.
Robert O.
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 3:37 PM
To: CF-Talk
Subject: RE: numberformat
yeah, i was about to say, math.
-----Original Message-----
From: Bryan Stevenson [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 3:35 PM
To: CF-Talk
Subject: Re: numberformat
divide by 100 ;-)
I'm not sure you can make a 7 display as a decimal value using
masks...but dividing by 100 will get ya there
Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]
---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com
----- Original Message -----
From: Robert Orlini
To: CF-Talk
Sent: Monday, November 17, 2003 12:17 PM
Subject: numberformat
How do I apply the numberformat mask to make a 7 view as .07?
Thanks.
Robert O.
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

