javascript display 2 number after comma

Solutions on MaxInterview for javascript display 2 number after comma by the best coders in the world

showing results for - "javascript display 2 number after comma"
Sebastián
13 Nov 2018
1var num = Number(0.005) // The Number() only visualizes the type and is not needed
2var roundedString = num.toFixed(2);
3var rounded = Number(roundedString); // toFixed() returns a string (often suitable for printing already)
4