MikeMcl / bignumber.js

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

let decimalPlaces accept negative values #262

Open mikekap opened 4 years ago

mikekap commented 4 years ago

round in various other settings accepts negative decimal places for rounding left of the decimal point. e.g.

new BigNumber('1234.5').decimalPlaces(0) => 1235.0
new BigNumber('1234.5').decimalPlaces(-1) => 1230.0

Would you consider a patch to let bignumber.js do this?

MikeMcl commented 4 years ago

Yes, I would consider it. It would need to be minimal and use ES3 syntax only.