Carrot reference
Functions
money()
Converts a given value to datatype Money, including currency conversion.
money(value[, currency])
- value - the value to be evaluated by the function.
- currency - (optional) the currency type of the returned Money value.
money(10) returns $10 if USD is the primary currency.
Input type | Return type | Logic |
---|---|---|
Number | Money | If a Number value is passed, the amount will be returned as a Money value with the specified currency type (default: org.currency). |
Money | Money | If a Money value is passed, the amount will be converted to the specified currency value if it is different from the original currency type. |
Unsupported data types | Null | Unsupported data types return Null. |