Join Slack
Powered by
And lastly, what is the best way to make sure curr...
# suitescript
k
Kris Wood
03/13/2019, 11:51 PM
And lastly, what is the best way to make sure currency values with several decimal places get calculated accurate when doing math on them?
b
battk
03/14/2019, 12:16 AM
If you are serious about rounding errors, you use a library like decimal.js or bignumber.js to do your math
battk
03/14/2019, 12:18 AM
otherwise you hope the floating number gods are in your favor and just set your number (or perhaps use .toFixed on it)
k
Kris Wood
03/14/2019, 12:30 AM
Yeah, I'm painstakingly going through line by line and changing every number to Math(myNumber*100)/100 at the moment.
a
alien4u
03/14/2019, 5:36 PM
Rounding with exponentials in the way to go in JavaScript
Open in Slack
Previous
Next