var coeff='0.1';
var amount='12.2';
var res = Math.floor(parseFloat(amount) / parseFloat(coeff));
console.log(res);
Why the result of this is 121
(I was expecting 122
)?
EDIT: my question was ambiguous: no trouble with the floor
function. I was just wondering why 12.2 / 0.1 is not equal to 122.