I knew javascript could have rounding issue with divisions, but not with multiplication. How do you solve those?
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 = 100
and t = 57674
r = 0.0017
(ok) and aff = 0.16999999999999998%
(arg)
How could I obtain aff = 0.17
?