0003. Money is integer sen
- Status: Accepted
- Date: 2026-10-27
Context
Section titled “Context”Floating-point arithmetic cannot represent most decimal amounts exactly, which causes rounding errors in totals, tax and reports.
Decision
Section titled “Decision”All money is stored, computed and transmitted as integer sen (RM12.90 is 1290). No floating point anywhere money is stored, computed or sent. Formatting money for display happens only in the money module of packages/core.
Consequences
Section titled “Consequences”- Rates (tax, service charge) are applied with integer arithmetic and an explicit rounding rule (half-up to the sen unless a rule says otherwise).
- API payloads and database columns carry integers, never decimal strings or floats.
- Code review rejects
numberarithmetic on money outside the money module.
For AI tools: llms.txt ·llms-full.txtopenkedai.com