Home Search

DriveWorks Pro 22
Dollar

Send Feedback

Dollar

Formats a number as text and applies the symbol for the system currency format.

When viewed in a browser this function will format the number to the clients culture.

For example when viewing in the Google Chrome browser with the Language set to use English (United States) the currency symbol $ will be used.

Syntax

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.

The DecimalPlaces value denotes the number of decimal places required in the string.

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.

Examples

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".

Example Outcomes

ValueDecimalPlacesOutcome
1234562"£123,456.00"
1234.564"£1,234.5600"
123.4561"£123.5"
123456.7892"£123,456.79"