Converts the first argument to a string using the format pattern string specified by the second argument.
string format-number(number, string, string?)
For the "format pattern" string, the following characters are supported "."; ","; "#"; and "0". The "#" character is used to describe integers. The "." and "," characters are used to describe the location and type of punctuation. The "0" character is used enforce digits before and after the "." character.
When truncating digits to the right of the decimal points, the number is rounded. The number to the left of the decimal point is never truncated.
Both parameters must be present or an error will be thrown. If the first parameter cannot be coerced to a number, the function should return NaN. If the second parameter is not a valid pattern string, the number that is the first parameter is returned as is.
The following function call returns "5,351":
format-number(5351,"#,###")
The following function call returns "5351.00":
format-number(5351, "#.00")
The following function call returns "53.5100":
format-number(53.51, "#.0000")
The following function call returns "0053.5100":
format-number(53.51, "0000.0000")
The following function call returns "0053.51":
format-number(53.51, "0000.####")
The following function call returns "53.6":
format-number(53.56, "0.0")