API version: unstable
API version: 2021-01 Release candidate
API version: 2020-10 Latest
API version: 2020-07
API version: 2020-04
API version: 2020-01
API version: 2019-10 Unsupported
API version: 2019-07 Unsupported

MoneyV2 object

Version unstable

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2021-01 (Release candidate)

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2020-10 (Latest)

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2020-07

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2020-04

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2020-01

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2019-10 (Unsupported)

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2019-07 (Unsupported)

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2

Version 2019-04 (Unsupported)

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
  style: 'currency',
  currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Fields

amount (Decimal!)

Decimal money amount.

currencyCode (CurrencyCode!)

Currency of the money.

Types that return MoneyV2