diff --git a/reference/strings/functions/money-format.xml b/reference/strings/functions/money-format.xml new file mode 100644 index 0000000000..31f15fd56b --- /dev/null +++ b/reference/strings/functions/money-format.xml @@ -0,0 +1,181 @@ + + + + + money_format + Formats a number as a currency string + + + Description + + stringmoney_format + stringformat + floatnumber + + + money_format returns a formatted version of + number. This function wraps the C library + function strfmon, with the difference that + this implementation converts only one number at a time. + + + The format specification consists of the following sequence: + + a % character + optional flags + optional field width + optional left precision + optional right precision + a required conversion character + + + + Flags + + One or more of the optional flags below can be used: + + + =f + + + The character = followed by a a (single byte) + character f to be used as the numeric fill + character. The default fill character is space. + + + + + ^ + + + Disable the use of grouping characters (as defined + by the current locale). + + + + + + or ( + + + Specify the formatting style for positive and negative numbers. + If + is used, the locale's equivalent for + + and - will be used. If + ( is used, negative amounts are enclosed in + parenthesis. If no specification is given, the default is + +. + + + + + ! + + + Suppress the currency symbol from the output string. + + + + + - + + + If present, it will make all fields left-justified (padded to the + right), as opposed to the default which is for the fields to be + right-justified (padded to the left). + + + + + + + + Field width + + + + w + + + A decimal digit string specifying a minimum field width. Field will + be right-justified unless the flag - is used. + Default value is 0 (zero). + + + + + + + + Left precision + + + + #n + + + + + + + + + + + + <function>number_format</function> Example + + For instance, French notation usually use two decimals, + comma (',') as decimal separator, and space (' ') as + thousand separator. This is achieved with this line : + + + +]]> + + + + + See also: number_format,sprintf, + printf and sscanf. + + + + +