Key Concepts › Localization
Money, Dates & Numerals
This page prevents a specific, expensive bug. Read it before you print a price.
Never do arithmetic on money
Every monetary value in the template context arrives as an object, not a number:
{ "amount": 24900, "currency": "OMR", "formatted": "24.900 OMR" }
amount is an integer count of the currency's smallest unit. formatted is that
amount already rendered for the shopper's language and the store's currency.
Print formatted. Never compute with amount.
{# Correct #}
<span class="price">{{ product.price.formatted }}</span>
{# Wrong — and broken in four currencies #}
<span class="price">{{ product.price.amount / 100 }} {{ product.price.currency }}</span>
Why dividing by 100 is wrong
Because not every currency has two decimal places.
| Currency | Country | Decimals | amount: 24900 means |
|---|---|---|---|
| OMR | Oman | 3 | 24.900 OMR |
| AED | UAE | 2 | 249.00 AED |
| SAR | Saudi Arabia | 2 | 249.00 SAR |
| KWD | Kuwait | 3 | 24.900 KWD |
| BHD | Bahrain | 3 | 24.900 BHD |
| JOD | Jordan | 3 | 24.900 JOD |
Tjjar Plus is an Omani platform, and the rial has three decimals: 1.500 OMR is 1500 minor units. A theme that divides by 100 shows an Omani shopper a price ten times too high on every product. It will look perfectly correct in Dubai and be catastrophically wrong in Muscat — which is why it survives testing and reaches production.
Nothing in the template language stops you. Arithmetic works — {{ product.price.amount / 100 }}
compiles and renders — so the protection is that you never need it: every amount arrives with
formatted already correct for its currency. Printing amount anywhere a shopper can see it is
a bug, whether or not you divide it.
Doing your own formatting
The money, number and date filters below are part of the published contract and arrive with
product pages. They are documented now so themes can be written against them; until they ship,
formatted is the only way to print a value, and it remains the right default after.
If you need a price in a context formatted does not cover — an aria-label, a JSON-LD
block, a content attribute — the money filter will read the currency's exponent from the
store rather than assuming one:
<meta itemprop="price" content="{{ product.price|money:'plain' }}">
<span aria-label="{{ product.price|money:'spoken' }}">{{ product.price.formatted }}</span>
Weight follows the same rule
Weight is an integer count of grams, for the same reason: a shipping band that ends at exactly 5 kg must not depend on binary floating point.
{ "grams": 1500, "formatted": "1.5 kg" }
Carriers bill whole kilograms rounded up, and that conversion happens before your template
runs. Print formatted.
Numerals in Arabic
Arabic text on a storefront uses Latin digits for prices, SKUs and order numbers —
249.00 and not ٢٤٩٫٠٠. This is not a stylistic preference: Gulf e-commerce has settled
on Latin digits for anything a shopper might read aloud to a call centre or paste into a
bank transfer, and Arabic-Indic digits in an order number cause real support load.
The platform handles this. formatted is produced with the ar-OM-u-nu-latn locale, so a
price is Arabic-punctuated with Latin digits. If you format a number yourself, use the
number filter rather than string interpolation:
{{ order.number|number }} {# 100482, not ١٠٠٤٨٢ #}
{{ product.stock|number }}
Dates render in the store's timezone
Never the shopper's browser timezone, and never UTC. A merchant in Muscat who sees an order placed at 23:40 needs it to say 23:40 in the order list, in the confirmation email and in your template — otherwise the same order appears to have happened on two different days.
{{ order.placed_at|date:'long' }} {# 12 مارس 2026 / 12 March 2026 #}
{{ order.placed_at|date:'short' }}
Note the digits in the Arabic example: Latin, as for prices. date here is Wajha's own filter
with named formats; it replaces the underlying engine's date, which takes Go layout strings
and is not part of the contract.
Date values arrive as objects with the conversion already applied:
{ "iso": "2026-03-12T19:40:00Z", "formatted": "12 March 2026", "timezone": "Asia/Muscat" }
Use iso only inside <time datetime="..."> and structured data, where a machine reads it.
Show formatted to people.
Summary
| Value | Never | |
|---|---|---|
| Price | price.formatted, or |money (planned) | amount, divided or not |
| Weight | weight.formatted | grams / 1000 |
| Numbers in Arabic | |number (planned) | raw interpolation |
| Dates | formatted, or |date:'long' (planned) | iso, to a shopper |