Numberformat - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

NumberFormat

Description
Creates a custom-formatted number value. Supports the numeric formatting used in the U.S. For
international number formatting, see
Returns
A formatted number value:
If no mask is specified, returns the value as an integer with a thousands separator.
If the parameter value is "" (an empty string), returns 0.
Category
Display and formatting functions
Function syntax
NumberFormat(number [, mask ])
See also
DecimalFormat, DollarFormat, IsNumeric,
History
ColdFusion MX: Changed behavior: if the mask format cannot correctly mask a number, this
function returns the number unchanged. (It does not truncate the number nor throw an error.)
(If no mask is selected, ColdFusion MX rounds the decimal part as ColdFusion 5 does. For
example, it rounds 34.567 to 35.)
Parameters
Parameter
number
mask
The following table explains mask characters:
Mask character Meaning
_ (underscore)
9
.
0
( )
+
-
,
L,C
LSNumberFormat
Description
A number.
A string or a variable that contains one. Set of characters that determine how
ColdFusion displays the number
Optional. Digit placeholder.
Optional. Digit placeholder. (Shows decimal places more clearly than _.)
Location of a mandatory decimal point.
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 plus sign before positive number; minus sign before negative number.
Puts a space before positive number; minus sign before negative number.
Separates every third decimal place with a comma.
Left-justifies or center-justifies number within width of mask column. First
character of mask must be L or C. Default: right-justified.
.
LSNumberFormat
NumberFormat
631

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents