Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
A string representing the given number using fixed-point notation. Scientific notation is used if the number's magnitude (ignoring sign) is greater than or equal to 1021 (same return value as Number.prototype.toString())
The toFixed() method returns a string representation of a number without using exponential notation and with exactly digits digits after the decimal point. The number is rounded if necessary, and the fractional part is p
Using toFixed() with negative numbers
Because member access has higher precedence than unary minus, you need to group the negative number expression to get a string.
Number.prototype.toPrecision()
This page was last modified on Jul 10, 2025 by MDN contributors.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.