返回一個字符串,其中包含一個以指數記數法表示的數字。
numObj.toExponential([fractionDigits])
numObj
必選項。一個 Number 對象。
fractionDigits
可選項。小數點后數字位數。必須在 0 – 20 之間,包括 0 和 20。
toExponential 方法返回一個字符串,該字符串代表一個以指數記數法表示的數字。該字符串中小數點之前有一位有效數字,并可能在小數點后有 fractionDigits 位數字。
假如沒有 fractionDigits 參數,toExponential 方法將返回足夠多位數字以便非凡地指定該數字。
版本 5.5
toFixed 方法 toPRecision 方法
應用于: Number 對象
新聞熱點
疑難解答