Menu

Multi-Currency Price Display Without FX Calls on Page Requests
📰

Multi-Currency Price Display Without FX Calls on Page Requests

DEV Community: go·Anton Makasin·4 days ago
#uo7nrBUA
#devtogo#devto#dev#currency#local
Long article (647 words) — no AI summary yet.
Reading 0:00
15s threshold

Towami has multiple country and currency configurations. Listings can show prices in the visitor's selected currency without calling an FX service during the request.

The Currency Selector

Each country offers its configured official currency and, when distinct, USD. A country configured with USD has no redundant second option. Visitors choose a display currency in the header, and that preference is stored in a cookie.

When the original listing currency differs from the viewing currency, we show an approximate conversion:

¢15,000,000 ~$28,846

Enter fullscreen mode

Exit fullscreen mode

The ~ prefix marks an indicative conversion, not the amount a payment provider guarantees. We omit it for the same currency and for the PAB/USD pair, which the application treats as 1:1.

Rates in the Database, Not on the Request Path

We store USD-based exchange rates in a settings table.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.