let num1 = 1012.2022;
console.log(num1.toFixed(1)); // 1012.2
console.log(num1.toFixed(2)); // 1012.20
console.log(num1.toFixed(3)); // 1012.202
console.log(typeof(num1.toFixed(1))); // string
let num2 = 1234.5678;
console.log(num2.toFixed()); // 1235
let num3 = 1012.2022;
console.log(num3.toFixed()); // 1012
let num4 = 1012.2022;
console.log(num4.toFixed(10)); //1012.2022000000