1let numObj = 12345.6789
2
3numObj.toFixed() // Returns '12346': note rounding, no fractional part
4numObj.toFixed(1) // Returns '12345.7': note rounding
5numObj.toFixed(6) // Returns '12345.678900': note added zeros
6(1.23e+20).toFixed(2) // Returns '123000000000000000000.00'
7(1.23e-10).toFixed(2) // Returns '0.00'
82.34.toFixed(1) // Returns '2.3'
92.35.toFixed(1) // Returns '2.4'. Note it rounds up
102.55.toFixed(1) // Returns '2.5'. Note it rounds down - see warning above
11-2.34.toFixed(1) // Returns -2.3 (due to operator precedence, negative number literals don't return a string...)
12(-2.34).toFixed(1) // Returns '-2.3'
13