Your results are slightly different than what I get when I test it.  I get
the string ***** if I try to stuff 1234.12 into a five character mask.

Make sure you have a sufficient number of mask characters to the left of the
decimal point.  You can always LTrim() the results to eliminat the leading
spaces.

NumberFormat(cost_price, "_______.00")

or

LTrim(NumberFormat(cost_price, "_______.00"))


Jim


----- Original Message -----
From: "Cameron" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, March 20, 2001 9:21 PM
Subject: Fighting with NumberFormat


> Hi all,
>
> I dunno if anyone has had this problem before, but I have been fighting
with
> NumberFormat for about an hour now...
>
> I am getting a Cost Price for a product from a database which stores the
> price as "Money".
>
> So I am trying to keep things consistant & remove the extra zeros' that
are
> returned (1234.1200). I'm _trying_ to use NumberFormat(cost_price,
"__.__")
> to format it as "0.00" etc.
>
> But I am getting some weird results
> cost_price=1234.12 => NumberFormat(cost_price, '__.__') =>1232.
> cost_price=50.00 => NumberFormat(cost_price, '__.__') => 50.00
>
> I have used combinations of everything I can think of
> 1234.1200 => '__.00' => 1232.
> 50.0000 => '__.00' => 50.00
>
> 1234.1200 => '00.9900' => 1234.12
> 50.0000 => '00.9900' => 50.0000
>
> etc, etc...
>
> Can someone PLEASE help me get this consitent... all I want is 2 decimal's
> after the decimal place, and any number before it.
>
> Cameron


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to