MikeMcl / bignumber.js

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

higher accuracy #328

Closed windkind88 closed 2 years ago

windkind88 commented 2 years ago

How do you display higher accuracy? example

x = new BigNumber('2');
z=x.sqrt()
console.log(z.toFixed());

now : 1.4142135623730950488 i hope: 1.414213562373095048801688724...

shuckster commented 2 years ago

BigNumber.config({ DECIMAL_PLACES: * })

windkind88 commented 2 years ago

BigNumber.config({ DECIMAL_PLACES: * })

thx! BigNumber.config({ DECIMAL_PLACES: * }); console.log(z.toFixed()); The result is an error

MikeMcl commented 2 years ago

BigNumber.config({ DECIMAL_PLACES: 100 });