ExampleCopy code to clipboard
const a = 10; console.log(a); console.log(a.toFixed(2));
The toFixed() method converts a number into a string, formatting it with a specified number of decimals.
25 Nov 2019
Author: Max Zorin
Would you recommend this example to your colleagues?