Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
toExponential() は Number 値のメソッドで、この数値を指数表記で表した文字列を返します。
オプションです。小数点の後の桁数を指定する整数です。 既定値はその数を表すのに必要な数の桁です。
Number オブジェクトを、指数表記 (小数点前は 1 桁、小数点の後は fractionDigits によって指定された桁で切り捨て) で表した文字列です。
fractionDigits が 0 以上 100 以下ではない場合に発生します。
TypeErrorこのメソッドが Number ではないオブジェクトに対して呼び出された場合に発生します。
fractionDigits 引数が省略された場合、小数点の後の桁数は、その値を特定するのに必要な桁数になります。
toExponential メソッドを 1 つの数値リテラル、または、指数も小数点もない数値リテラルに対して使用する場合、ドットが小数点として解釈されることを防ぐために、メソッド呼び出しに先立つドットの前に空白を置いてください。
引数 fractionDigits で指定された桁よりも多くの桁を持っている数の場合、その数は、fractionDigits の桁で表すことができる最も近い数で表されます。toFixed() メソッドの説明における概数表現の説明を参照してください。それは、toExponential メソッドにも適用されます。
| ECMAScript® 2027 Language Specification # sec-number.prototype.toexponential |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2026年4月12日 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.