Skip to Content
FeaturesCurrency

Currency

Hoikka is single-currency in practice: everything is EUR. Multi-currency exists only as a schema placeholder — there is no conversion logic wired up anywhere, so treat EUR as effectively hardcoded.

What is real

  • All prices are EUR, stored in cents (minor units) as integers to avoid floating-point errors — 2999 means 29,99 €.
  • Formatting goes through the shared formatPrice helper.
import { formatPrice } from "$lib/utils"; formatPrice(2999); // "29,99 €"

formatPrice reads the base currency (BASE_CURRENCY = "EUR") and the display locale from config. Because nothing sets a non-EUR currency, you will only ever see EUR output in practice.

What is a placeholder

The orders table has two currency columns:

currency_code TEXT DEFAULT 'EUR' NOT NULL, -- always 'EUR' exchange_rate NUMERIC DEFAULT '1' NOT NULL -- always 1

New orders are created with currencyCode: "EUR" and exchangeRate: "1", and nothing ever changes them. There is no currency selector, no rate lookup, and no place in the checkout or pricing path that converts amounts.

A convertPrice(cents, rate) helper exists in $lib/utils, but no application code calls it — it is unused outside of its unit test.

If you want real multi-currency

You would need to build it: a way to select/detect a currency, a source of exchange rates, conversion at display and at order creation (stamping the locked rate onto the order), and formatting per currency. The schema columns and the convertPrice helper are a starting point, not a working feature.

Last updated on