I am facing an issue with rounding decimals in JavaScript using toFixed.
const num1 = (100.555).toFixed(2) // "100.56"
const num2 = (10.555).toFixed(2) // "10.55"
Can any one explain why this behavior happens? Why first example round the decimals to 56 while the second one turn it to 55?
Update: If i add 4 decimals then rounding is differnt.
const num3 = (10.5555).toFixed(2) // "10.56"