Carrot reference
...
Fields
Data Types

Money

A datatype used to represent a monetary value.

Properties

Property

Type

Description

amount

Number

The amount of money

currency

Currency

The currency of the money (e.g. USD or EUR)

asOrgCurrency

Money

Converts the money to the org's default currency, (using the current exchange rate in effect as-of the evaluation date).

Type Conversions and Money Math

Money values can use any math operations, such as addition, subtraction, rounding and division.

  • If two Money values of the same currency are used together in a formula, they will be added normally. (Example: EUR100 + EUR200 = EUR300)
  • If two Money values of different currencies are used together in a formula, they will be converted to the org's default currency, using the exchange rate currently in effect as-of that date.
  • If a Money value is used together with a non-Money numeric value, such as Number or Percent, then the non-Money value will be converted into Money of the the same currency as the Money. (Example: USD1000 + 1000 = USD2000)

Representing Money

To represent a Money in an expression, use the money() function. You can also use this function to convert between money currencies.

  • For example: money(1000, 'USD') will resolve to USD $1000



Updated 20 Nov 2024
Doc contributor
Doc contributor
Did this page help you?