I have a question regarding toFixed() function. I have some float numbers e.g. 160.325 and 5.325. The returned value of toFixed() function  supposed to be 160.33 and 5.33 respectively but it returns 160.32 for 160.325 and 5.33 for 5.325.
I have tried in different ways,
Number(160.325).toFixed(2)
"160.32"
Number(160.326).toFixed(2)
"160.33"
Number(5.325).toFixed(2)
"5.33"
Number(160.425).toFixed(2)
"160.43"
I expect output to be 160.33 and 5.33.


(160.325).toFixed(20)gives 160.32499999999998863132. It's floating point mathematics that is to blame here.rounded = (Math.round(x * 100) / 100).toFixed(2);