Money and languages

Show prices correctly in every currency, language and writing direction.

A price has an amount and a currency. The shopper's language decides how it is written: digits, separators, grouping and where the symbol goes. Changing the language never converts the currency.

The same price in different languages#

Language

INR 1234567.89

INR 0.00

INR -1234567.89

en

₹1,234,567.89

₹0.00

-₹1,234,567.89

en-IN

₹12,34,567.89

₹0.00

-₹12,34,567.89

fr

1 234 567,89 ₹

0,00 ₹

-1 234 567,89 ₹

de

1.234.567,89 ₹

0,00 ₹

-1.234.567,89 ₹

de-CH

₹ 1'234'567.89

₹ 0.00

₹-1'234'567.89

ar

‏1,234,567.89 ₹

‏0.00 ₹

‏‎-1,234,567.89 ₹

he

‏1,234,567.89 ‏₹

‏0.00 ‏₹

‏‎-1,234,567.89 ‏₹

fa

‎₹۱٬۲۳۴٬۵۶۷٫۸۹

‎₹۰٫۰۰

‎−‎₹۱٬۲۳۴٬۵۶۷٫۸۹

hi

₹12,34,567.89

₹0.00

-₹12,34,567.89

bn

১২,৩৪,৫৬৭.৮৯₹

০.০০₹

-১২,৩৪,৫৬৭.৮৯₹

ja

₹1,234,567.89

₹0.00

-₹1,234,567.89

Every supported language is in the language reference.

Decimal places#

Each currency has its own number of decimal places: two for INR and USD, none for JPY, three for KWD. Some currencies display fewer than they store; IDR stores two and displays whole rupiah.

Currency

Accepted amount

Displayed in English

INR

1234.56

₹1,234.56

JPY

1234

¥1,234

KWD

1234.567

KWD 1,234.567

IDR

1234.56

Rp 1,235

Every currency is in the currency reference.

vascula
{{ product.price.current | money }}                   {# ₹1,850.00 #}
{{ product.price.current | money: trim_zeros: true }} {# ₹1,850 #}

A price always shows its currency's decimal places. Add trim_zeros: true to leave them out when the amount is whole. This changes only how the price is written, never the amount charged.

Prices in a theme#

vascula
{{ product.price.current | money }}
vascula
{% if product.price_range.has_range %}
  {{ product.price_range.min | money: isolate: true }} – {{ product.price_range.max | money: isolate: true }}
{% else %}
  {{ product.price.current | money: isolate: true }}
{% endif %}

money takes a price value, such as product.price.current, and formats it in the shopper's language. A plain number, a missing currency or more decimal places than the currency allows is an error. Never build a price by joining a symbol and a number.

Right-to-left languages#

Storefront pages set dir="rtl" on the html element for right-to-left languages. Use CSS logical properties such as margin-inline-start so the layout works in both directions, and keep the formatted price as it is.

When a price sits inside translated text or next to punctuation, use money: isolate: true. It keeps the whole price together when left-to-right and right-to-left text mix.

Check negative prices, currency codes and line wrapping in both directions.

The shopper's language#

localization.locale is the active language, and localization.available_languages lists the store's languages with their code, name and rtl flag. Choosing a country can also change the currency. See Locale, country, and currency.

Translate labels such as "Subtotal" with the t filter and your theme locale files.

Money in APIs#