money_format - Changes the format of a number as a currency string
money_format(number,lg,dollar,dot,separator,iffloat,fr,before,after)
money_format(number, options:context)
- dot : specify the separator between number and fractional part
- separator : specify the separator for large number
- sign_separator : specify the separator between the $ sign and the. umber
- lg : support fr or en and defined wheer the $ will be place and the default separator for large number
- before : replace the $ sign by this before the number
- after : replace the $ sign by this after the number
- fr : specify the number of digit in the fractional part
- float : if the fractional part is 00 and this is false, then 00 will not be displayed
- dollar : specify the dollar sign
- sign_possition: left or right
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 money_format(12, options: { "float": false }); // return 12 $ money_format(12, options: { "after": '%' }); // return 12,00%
{{ include("includes/strings.sn") }}
Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>
1.0 2014-09-09 21:24:14 laplante@sednove.com
1.1 2021-10-18 laplante@sednove.com add sign_position
Edit© 2024 extenso Inc. All rights reserved.