Function: getDecimalPlaces()
ts
function getDecimalPlaces(num): number;Get the number of decimal places in a number. 获取数字的小数位数。
Parameters
| Parameter | Type | Description |
|---|---|---|
num | number | A number to find the decimal places of / 要查找小数位数的数字 |
Returns
number
The number of decimal places / 小数位数
Example
ts
getDecimalPlaces(1.005) // => 3
getDecimalPlaces(5) // => 0Since
1.0.0