function

money_format . string . sncode

VERSIONlatest Formats a number as a currency string.

MONEY_FORMAT

NAME

money_format - Changes the format of a number as a currency string

SYNOPSIS

money_format(number,lg,dollar,dot,separator,iffloat,fr,before,after)

PARAMETERS

number --The number to be formatted.
lg -- Language dollar
dollar -- Dollar symbol
dot -- Dot symbol separator Separator symbol
iffloat -- Returns float format if the value has decimals, it returns an integer otherwise
fr Fractional part size (default 2)
before String before value (default dollar symbol for en, nothing for fr)
after String after value (default dollar symbol for fr, nothing for en)
 

RETURN

string
Returns the formatted string.

EXAMPLES

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

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

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

a = 1899.8;

money_format(a,"fr","$",","," ", true, 1); //return 1 899,8$
money_format(a,"en","$",".",",", true, 1);//return $1,899.8

AUTHOR

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