Just go give 2 ways of doing money storage in ints from Google's APIs...
For Google's Standard Payments APIs, we use micros: https://developers.google.com/standard-payments/v1/fops/bank...
> To represent a monetary value in micros, multiply the standard currency value by 1,000,000.
> USD$1.23 = 1230000 micro USD
Sadly, its different than other parts of Google with money/amount based APIs. GCP uses units + nanos: https://cloud.google.com/billing/v1/how-tos/catalog-api
> [UNITS] is the whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.
> [NANOS] is the number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.
Something to do with using floats to indicate cardinality briefly plummeted, but was summarily dismissed.
Regardless, losing track of the numbers to accounts reminded me of this one place I worked where the transaction geese weren't recorded as explicit callouts on the transaction ledger, but rather had to be cross-referenced with final transaction amounts and the fee configuration for time period, but where the changing of fee configurations were not tracked with a granularity sufficient for resolving all ambiguity come audit time.
And I thought that was bad.
Typedef int64_t CAmount;
Static const CAmount COIN = 100000000;
Static const CAmount MAX_MONEY = 21000000 * COIN;