NumberFormat

"-->
 NumberFormat (number, [, mask ]) 

Description

Creates a custom-formatted number. The following characters can be used for the mask:

  • _ (underscore) Digit placeholder.

  • Nine-digit placeholder Shows decimal places more clearly than an underscore.

  • . Location of a mandatory decimal point (or locale-appropriate symbol).

  • 0 Located to the left or right of a mandatory decimal point. Pads with zeros.

  • ( ) If number is less than zero, puts parentheses around the mask.

  • + Puts a plus sign before a positive number, a minus sign before a negative number.

  • - Puts a space before positive number, a minus sign before a negative number.

  • , Separates every third decimal place with a comma.

  • L,C Left-justifies or center-justifies the number within the width of the mask column. The first character of mask must be L or C. Default: right-justified.

  • $ Puts a dollar sign (or locale-appropriate symbol) before a formatted number. The first character of mask must be the dollar sign ($).

  • ^ Separates left and right formatting.

Example

 <cfloop FROM = 1 TO = 9 INDEX = "examplenumber">  <cfset examplenumber2 = Evaluate(examplenumber * sqr(2))>  <cfoutput>  #NumberFormat(examplenumber2,'_____.__')#  </cfoutput>  </cfloop>  


Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net