function

number_format . string . sncode

VERSIONlatest Formats a number as a regional number string

NUMBER_FORMAT

NAME

number_format - Changes the format of a number as a regional number string

SYNOPSIS

number_format(number,lg,dot,separator,iffloat,fr)

PARAMETERS

number
The number to be formatted.
lg
Language
dot
Dot symbol
separator
Separator symbol
iffloat
It returns a float format if the value has decimals, otherwise it returns an integer
fr
Fractional part size (default 2)

RETURN

string
Returns the formatted string.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

in:  res={_{number_format(1234567.3,"en")}}.
out: res=1,234,567.30.

in:  res={_{number_format(1234567.345,"fr")}}.
out: res=1 234 567,35.

a = 1899.8;
number_format(a,"fr",","," ", true, 1);//return 1 899,8
number_format(a,"en",".",",", true, 1);//return 1,899.8

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>