toPrecisionbeginner// Format number to a specified precision
(123.456).toPrecision(5) // β '123.46'
(0.000123).toPrecision(2) // β '0.00012'Use toPrecision() to format a number to a total number of significant digits, which is useful in scientific or measurement contexts.