Formats a number as text and applies the symbol for the system currency format.
For example when viewing in the Google Chrome browser with the Language set to use English (United States) the currency symbol $ will be used.
Dollar([Number], [DecimalPlaces])
Where:
Number is the number to convert.
DecimalPlaces is a number between 0 and 15 representing the amount of decimal places to be returned.
If more decimal places are required than are present in the string, then the rest of the decimal places are made up of zero's.
If less are required, then the number value is rounded off to the nearest decimal unit to match the number of decimal places required.
Rule | Meaning |
---|---|
Dollar(123456, 2) | The function takes the value of 123456 and converts it to a string with the default currency formatting applied. This results in "£123,456". The function then takes the decimal places value and applies it to the currently formatted value. In this case, two decimal places are required, so the final outcome is "£123,456.00". |
Value | DecimalPlaces | Outcome |
---|---|---|
123456 | 2 | "£123,456.00" |
1234.56 | 4 | "£1,234.5600" |
123.456 | 1 | "£123.5" |
123456.789 | 2 | "£123,456.79" |