var result = 0.1 + 0.2;
alert( +result.toFixed(10) ); // 0.3
var result = 0.1 + 0.2;
alert(result.toFixed(10));
alert(+result.toFixed(10));
> (1e+21 / 100).toFixed(2)
'10000000000000000000.00'
> (1e+21 / 10).toFixed(2)
'100000000000000000000.00'
> (1e+21 / 1).toFixed(2)
'1e+21'