Urgent.News

What's breaking now, across thousands of outlets.

Tech

Our displayed price is allowed to be wrong in one direction only, and Intl decides how many decimals it is wrong by

Notifio is a £20 one-time purchase. Not £20 in the UK and something else elsewhere: every Checkout Session is created in GBP pence, the webhook records GBP, the licence is GBP. There is exactly one currency in this business. There are twenty-four currencies on the website, though, because a visitor in Berlin reading "£20" has to do a conversion in their head before they can decide whether that is…

The displayed price on Notifio can be inaccurate, but it will never be lower than the actual cost. The one rule governing this discrepancy is that the displayed price must always be an upper bound. Prices are shown in an approximate local currency to help visitors decide if a product is worth purchasing. This introduces a margin of error, but the rule ensures the displayed price is never less than what the customer will actually be charged.

The pricing system uses the mid-market exchange rate as the basis, but actual conversion fees from banks or card issuers can add 2 to 4 percent to the total. These fees are applied after the price is displayed. To avoid under-quoting the price, a buffer of 1.04 is used, which ensures the displayed price is always an upper bound.

Not all currencies use decimal places, so the system determines how many decimal places each currency uses based on the visitor's locale. For example, Japanese Yen (JPY) doesn't use decimals, while currencies like Icelandic Króna (ISK) and Hungarian Forint (HUF) also don't. If a price is already an exact retail price, no additional rounding is applied.

Zero is passed through without modification, ensuring free tier prices remain at £0. The function that converts the price for display first checks for finite values, then rounds the result to the appropriate number of decimal places based on the currency's format.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

What vx is, and what it refuses to be

Every monorepo tool eventually describes itself with a paragraph of nouns: caching, task graph, remote execution, affected detection, generators, a dashboard, a cloud.

  • vx is a monorepo tool with a five-stage pipeline for task management
  • Tasks in vx defined as shell commands with declared inputs and outputs
  • vx focuses on correctness and speed, avoiding cloud and cloud-related features

More from Friday 9 October →