The Covex agent: ask about your operations in plain languageCovex agent: ask in plain languageRead more
TODODraft — to be reviewed by Covex before publication

Amounts in øre: why Covex never stores money as decimals

Corner of a plaster wall in warm light with a sharp shadow

Author

TODOAuthor

Published

Draft

The convention

In Covex an amount is stored as an integer in the smallest unit — øre — together with a currency code. Never as a decimal.

A decimal can't always represent an amount exactly, and small rounding errors grow when lines are added up on an invoice, split across orders or converted to another currency. An integer in øre is exact, and the currency code travels with it, so an amount is never read in the wrong currency.

Illustrative example
// Amount as an integer in the smallest unit + currency codetype Amount = { minor: number; currency: string };const price: Amount = { minor: 124950, currency: "DKK" }; // DKK 1,249.50

Prices have versions

The same care applies to tariffs. Ingrid works out the price from zones, the lane matrix, weight bands and the customer segment, and prices are versioned: historical orders keep the version they were priced with. A new tariff version therefore doesn't change the price of an order that has already been priced.

Where it shows

  • Quote sheets are calculated line by line against the tariff.
  • Supplier invoices are split down to the individual orders.
  • Surcharges and rates: fuel by index, environment, island, weekend and currency.
  • Reports show revenue, cost and contribution margin (DB1) per month, customer, department, forwarder and lane.

The author

TODOAuthorTODORole

Help build Covex.

Transport management from enquiry to invoice — built so every figure can be explained.

A ribbed glass door with warm light behind

See Covex at work — from enquiry to invoice.

The quote, the order, dispatch, the trip, the driver, the invoice and the settlement in one system. No spreadsheets on the side, no double entry.

A ribbed glass door with warm light behind