Function: toFixed()
ts
function toFixed(value, decimals): string;Format as fixed-point string without scientific notation. 格式化为定点数字符串,不使用科学计数法。
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Number to format / 待格式化的数 |
decimals | number | Decimal places / 小数位数 |
Returns
string
Fixed-point string / 定点数字符串
Example
ts
toFixed(0.000001, 8) // => '0.00000100'Since
1.0.0