AUD amount modelling
Replace floating-point amounts without rewriting history
A decimal migration must distinguish representation cleanup from a change in financial meaning. Preserve original evidence and reconcile differences before switching readers.
In this article
Inspect how the old values were produced
Inventory database columns, application calculations, exports and provider adapters. A column labelled amount may contain dollars in one path and cents in another. Resolve that ambiguity before selecting a conversion expression.
Determine whether existing values represent rates, intermediate results or settled amounts. Rounding every record to two decimal places can destroy valid rate precision and alter future calculations.
Keep a copy of the original representation and its provenance under the approved records policy. A decimal conversion cannot recover an intended value that was already lost to an earlier calculation.
Define conversion with the calculation owner
Separate mechanical conversion from business correction. Converting the stored approximation to a chosen decimal representation is one action. Deciding what a past customer should have paid is another.
Use representative records and independently approved expected values. Classify discrepancies as explainable representation changes, known historical defects or unresolved cases.
Do not automatically update external settled transactions to match a new internal result. Any adjustment needs the established business process and a link to its original evidence.
Run old and new paths side by side
Add new fields and readers before replacing the old representation. Backfill in resumable batches, protecting records edited during the migration.
Compare calculations in shadow mode without creating duplicate payments. Record differences by transaction and policy, including cases where the displayed value matches but the stored precision differs.
Test rollback after new writes begin. An old reader may not understand a decimal-string API or integer-minor-unit field. Keep a compatibility plan that preserves new transactions rather than restoring a stale database snapshot.
Switch only after the boundaries agree
Validate the application runtime, database driver, API schema, report export and payment adapter together. A decimal database with a floating-point intermediate in the client is an incomplete migration.
Update historical reporting deliberately. Some reports should reproduce the original recorded amount, while forecasts may use the new calculation policy. Label that distinction in the data model.
Retire the old fields after reconciliation and dependency checks. Keep unresolved records visible to an owner instead of forcing them through a conversion merely to achieve a complete migration count.
Primary sources
PostgreSQL: numeric typesReferences checked 11 September 2026.