Simple maths with JS gets wrong when using decimals.
console.log(.6+.6+.6) //1.7999999999999998
One possible solution could be multiply each number by a million and then divide it by a million, but seems is not efficient at all.
console.log(((.6*1000000)+(.6*1000000)+(.6*1000000))/1000000) //1.8
Is there any "proper" way to sum with decimals in JS without a library?
If it isn't must recommendations are to use other libraries like https://github.com/MikeMcl/bignumber.js/ or https://github.com/MikeMcl/decimal.js/ or https://mathjs.org/ which one you recommend?
At the moment I believe would be better to multiply only by 1000000 and divide it later, this way I do not have to install a whole module for the "basic" operations... but again, basic operations in JS are not basic.