3 ms·
Show HN: Currency, a Go package to do currency computations
- bnkamalesh 6y agoCurrency package helps you do exactly what it says, currency computations. It lets you do sub-unit(e.g. cents is a sub-unit of dollar) manipulations as well. It takes care of carry over values in division, i.e. consider 1 dollar divided by 3, it'll return 3 currency instances with 34, 33, 33 as the values instead of 33.3333.
- bengtan 6y ago> It takes care of carry over values in division, i.e. consider 1 dollar divided by 3, it'll return 3 currency instances with 34, 33, 33 as the values instead of 33.3333. I think the proper/common name for this is 'allocation', not 'division'. For example, see https://frontstuff.io/how-to-handle-monetary-values-in-javascript https://frontstuff.io/how-to-handle-monetary-values-in-javas... and look for the subheading 'Pitfall #3: Percentage vs. allocation'.