Open brycefisher opened 7 years ago
fwiw I prefer cents to avoid thinking about number precision. Cents are the lowest unit we can track and its easy to see you are using it correctly - pass in an integral amount.
Agree with Lei. We want to move to using cents everywhere to remove the
confusion & impedance mismatch that Bryce describes. Cents
being the
primary interface to goodeggs-money
is the opinioned way to express this.
On Fri, Dec 9, 2016 at 1:34 PM, Lei notifications@github.com wrote:
fwiw I prefer cents to avoid thinking about number precision. Cents are the lowest unit we can track and its easy to see you are using it correctly
- pass in an integral amount.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/goodeggs/goodeggs-money/issues/3#issuecomment-266129625, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGwuEd4MfzpaEV4bMDVMO5qEwn1InXMks5rGclYgaJpZM4LJJJY .
-- Alon Salant | Good Eggs
dig in: market https://www.goodeggs.com/sfbay/home | seasonal recipes https://www.goodeggs.com/sfbay/seasonal-recipes | instagram https://instagram.com/goodeggs/
In the handful of places I've personally used this module, I've nearly always been starting from and ending with dollars, not cents. I imagine that many others who use this feel the same way?
My proposal would be to change from this kind of usage:
to something like this:
Haven't thought too deeply about the implementation of this change, but it feels like the API I would want.
For what it's worth, this is much closer to API for the currency.js module that I quite like.
Thoughts?