toFixedbeginner// Format number with fixed decimal places
(3.14159).toFixed(2) // β '3.14'
(1.5).toFixed(0) // β '2'
(100).toFixed(2) // β '100.00'Use toFixed() to format a number as a string with a specific number of decimal places, commonly used for monetary values.
(1234.5).toFixed(0) rounds to the nearest integer and returns a string.