MikeMcl / bignumber.js

A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic
http://mikemcl.github.io/bignumber.js
MIT License
6.68k stars 742 forks source link

Wrong return type of decimalPlaces() #319

Closed pobch closed 2 years ago

pobch commented 2 years ago

According to the doc:

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.

MikeMcl commented 2 years ago

Thank you for letting me know.

robbiedood commented 1 year ago

Got the same issue +1 Was wondering which version can resolve the issue. Thx.

MikeMcl commented 1 year ago

@lukelu0520

I'm sure you can find that out for yourself.