fixed
  • Overview
  • Constructors
  • Scale
  • Parsing
  • Formatting
  • Performing math
  • Comparison
  • Storing
Powered by GitBook
On this page

Was this helpful?

Storing

Storing fixed amounts

If you need to store or transmit a fixed value we recommend that you store the value as two discrete numbers:

  • minorUnits

  • scale

Both values should be stored as integers. If storing in a database minorUnits may need to be stored in a large int type.

Storing the value using this technique guarantees no precision loss when storing, transmitting or retrieving Fixed decimal values.

PreviousComparison

Last updated 2 years ago

Was this helpful?