goodeggs / goodeggs-money

Reliable money math with BigNumber wrapped inside Cents
MIT License
3 stars 0 forks source link

Drop BigNumber #2

Open hurrymaplelad opened 8 years ago

hurrymaplelad commented 8 years ago

It's ~16k minified. We're only using it for consistent rounding. We prefer to serialize cents as JSON Numbers, so we already don't support arbitrarily large numbers. This is not something we will likely ever need to support for a single shopper's flow. Let's keep things simple by preferring Number representations and acknowledging their limitations. Let's add larger libraries for high precision math and arbitrarily large ints only where and once we need them (accounting systems?)

hurrymaplelad commented 8 years ago

Also, with integer cents, Math.round() is stable and predictable. Seems like we only need one of BigNumber or integer cents for predictable money math.