If dp is omitted, or is null or undefined, the return value is the number of decimal places of the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN
By the way, the return type of decimalPlaces() is just number, which is wrong. The correct type should be number | null.
According to the doc:
By the way, the return type of
decimalPlaces()
is justnumber
, which is wrong. The correct type should benumber | null
.