Comment on page
Storing and Send
When storing and sending monetary amounts you need to ensure that you retain the precision and scale of the amount.
The best way to do this is to store the amount is three components.
- Minor units
- Currency Code
A value of $AUD1.99 would be stored as:
Minor Units: 199
Currency Code: AUD
Using this technique guarantees you will always get back the amount you stored or transmitted.
If you are only using a single currency the Fixed package provides tools to store the minor unites and scale.