Carrot reference
Functions

money()

Converts a given value to datatype Money, including currency conversion.

Syntax

money(value[, currency])

  • value - the value to be evaluated by the function.
  • currency - (optional) the currency type of the returned Money value.
  • Return type: Money

Sample usage

money(10) returns $10 if USD is the primary currency.

Supported data types

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.



Updated 04 Oct 2023
Doc contributor
Doc contributor
Did this page help you?