NumberFormat()

Creates a custom-formatted number value. For international number formatting use LSNumberFormat().

[mask - quickly]

  • _,9 Digit placeholder; . decimal point; 0 Pads with zeros;
  • ( ) less than zero, puts parentheses around the mask
    • plus sign before positive number minus before negative
  • - a space before positive minus sign before negative
  • , Separates every third decimal place with a comma.
  • L,C Left-justifies or center-justifies number
  • $ dollar sign before formatted number.
  • ^ Separates left and right formatting.
NumberFormat( number=any, mask=string );

Returns: String

Argument Description
number
any, required

A number.

mask
string, optional

_ = optional digit . = decimal point 0 = mandatory digit

Examples

dump(numberFormat(1.234,'__.00')); // 1.23
dump(numberFormat(1234,'__.00')); // 1234.00

See also