Discount Ninja
Search
K
Comment on page

Money

Attributes

amount (number)
  • The amount, expressed in cents
currency (string)
type ("product-page" | "collection" | "drawer-cart-product" | "drawer-cart-line" | "drawer-cart-total" | "cart-product" | "cart-line" | "cart-total")
  • Indicates the type of money field to render
  • If present, the component retrieves the values of the underlying attributes from the context, specifically from discountNinjaContext.Settings.MoneyFormatting

Underlying attributes

include-currency (boolean)
  • true [default]: renders the currency or currency symbol
  • false: does not render the currency or currency symbol
use-currency-symbol (boolean)
  • true [default]: uses the symbol instead of the three letter ISO 4217 code of the currency (e.g. USD becomes $)
  • false: uses the three letter ISO 4217 code of the currency
include-trailing-zeros (boolean)
  • false [default]: excludes the decimal separator (either . or ,) and trailing zeros.
  • true: always includes the decimal separator (either . or ,) and the digits after the decimal point
precision (number)
  • The number of digits after the decimal point.
  • Supported values: 0, 1 or 2 [default]
  • The default value is 2, e.g. 123.45
  • Reducing the precision causes rounding.
zero-is-free (boolean)
  • true [default]: if the amount is zero the component renders the label "Free"
  • false: if the amount is zero the component renders 0
cents-superscript (boolean)
  • false [default]
  • true: the digits after the decimal point are rendered in superscript and the decimal separator (either . or ,) is omitted
The following attributes are obsolete and will be removed in an upcoming release
unit (string)
  • Used to display a price per unit
  • If present, the unit is displayed after the money part, separated by a forward slash, e.g $2.5/Kg
override-separator (string | null)
  • null [default]: the component decides if the literal used to separate the currency and the amount should be used based on the locale and the currency
  • overrides which literal should be used to separate the currency and the amount
override-currency-position ("before" | "after" | null)
  • null [default]: the component decides if the currency is placed before or after the amount
  • overrides the currency position
free-label (string)
  • Localized label to display if the amount is zero and zero-is-free is true