I knew that javascript might have the problem of rounding off with divisions, but not with multiplication. How do you solve them?
var p = $('input[name="productsUS"]').val().replace(",", ".");
var t = $('input[name="productsWorld"]').val().replace(",", ".");
if (p >= 0 && t >= 1) {
var r = p / t;
r = Math.round(r * 10000) / 10000;
var aff = (r * 100) + "%";
if p = 100andt = 57674
r = 0.0017(ok) and aff = 0.16999999999999998%(arg)
How could i get aff = 0.17?
source
share