We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const number = 12.3456 new Big(number).truncate(3) // 12.345 truncate 3 decimal places number.toFixed(3) // 12.346 rounding
The text was updated successfully, but these errors were encountered:
See round and Big.RM.
const number = 12.3456 Big.RM = 0 // ROUND_DOWN i.e. truncate new Big(number).round(3) // 12.345 number.toFixed(3) // 12.345
or leave Big.RM alone and pass a rounding mode
Big.RM
const number = 12.3456 const truncate = 0 new Big(number).round(3, truncate) // 12.345
Sorry, something went wrong.
No branches or pull requests
Fake API
The text was updated successfully, but these errors were encountered: