The only way I have been able to get it to do it is:

<CFIF varnum LT 10>
        <cfset newnum = 0#varnum#>
<cfelse>
        <cfset newnum = #varnum#>
</cfif>

Larry Juncker
Senior Cold Fusion Developer
Heartland Communications Group, Inc.


-----Original Message-----
From: Barney Stevenson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 03, 2001 11:33 AM
To: CF-Talk
Subject: numberformat()


Hi guys

Probably a no-brainer, this one, but I can't seem to work it out:

what numberformat mask should I use to output a number so that it a)
has a leading zero if it is less than one and b) formats correctly if
it is ten or more?

I've tried:

0.99 - doesn't work for numbers of 10 or more (you end up losing the
second decimal place)

9990.00 - ends up putting four leading zeros (is this a bug?)

9999.99 - doesn't show the leading zero for numbers less than one.

Any suggestions?

Thanks

Barney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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