Goto main content

number_format

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

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.