3 ms·
From their docs [1] it looks like they do everything using integers: the amounts are integers in the "minor unit" of currency, for example cents if the currency
by benhoyt 2y ago
From their docs [1] it looks like they do everything using integers: the amounts are integers in the "minor unit" of currency, for example cents if the currency is dollars. So 1000 means $10.00. In languages like JavaScript where everything is a float64, you can still accurately represent integers up to 2^53, which would be $90 trillion.
[1] https://increase.com/documentation/api#transactions https://increase.com/documentation/api#transactions
- deleted 2y ago[deleted]
- crabmusket 2y agoThis isn't sufficient to represent prices which often include fractional amounts of cents in non-retail scenarios. Think of AWS server prices per hour.
- krainboltgreene 2y agoFunny, because that's exactly what Stripe does (https://docs.stripe.com/billing/subscriptions/usage-based/pricing-models#decimal-amounts https://docs.stripe.com/billing/subscriptions/usage-based/pr...)
- crabmusket 2y agoBut those are decimal values, not integers. I didn't mean that using cents as a unit was insufficient, I meant that using integers was.