How to Format Currency
Format currency in Collaborate documents.
You can use the following formula to convert variables into currency within your documents or templates:
{{ number_to_currency(variablename) }}
The variable name must be lowercased and also must begin and end with {{ }}.
For example, you might use the following syntax:
Second_Number = 1000.32
Input: {{ number_to_currency(second_number) }}
Return: $1,000.32
This defaults to $ as the unit and a comma as the delimiter.
You can change a unit by using unit: “X”
Input: {{ number_to_currency(second_number, :unit=>”£” )}}
Return: £1,000.32
You can change delimiters by using delimiter: “X”
Input: {{ number_to_currency(second_number, :delimiter=>”.”) }}
Return: $1.000.32
Combine unit and delimiter changes like this:
Input: {{ number_to_currency(second_number, :delimiter=>’,’, :unit=>’¢’ ) }}
Return: ¢1,000.32
You can add precision as well:
Input: {{ number_to_currency(second_number, :precision=>3) }}
Return: $1,000.324