Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
JavaScript の例外 "precision is out of range" は、 toFixed または toPrecision に 0 から 20 (または 21) までの範囲外の数値が渡された場合に発生します。
これらのメソッドのいずれかで、 範囲外の精度を引数を使用しています。
これらのメソッドで許可されている範囲は、通常 0 と 20(または 21)の間です。しかし、ECMAScript 仕様では、この範囲の拡張が認められています。
| Number.prototype.toExponential() | 0 から 100 | 0 から 20 |
| Number.prototype.toFixed() | -20 から 100 | 0 から 20 |
| Number.prototype.toPrecision() | 1 から 100 | 1 から 21 |
This page was last modified on 2023年8月18日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.