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
I'm expecting the result of the roundUp to be 1.12, but it returns wrongly 1.13.
const Big = require('big.js'); const amountAvailable = 1.12; const quantityArs = 1197.5384615384617; const exchangeRate = 1069.2307692307693; // Big console.log(Big(amountAvailable).times(exchangeRate).toNumber()); // 1197.5376 console.log(Big(quantityArs).div(exchangeRate).toNumber()); // 1.12 console.log(Big(quantityArs).div(exchangeRate).round(2, Big.roundUp).toNumber()); // 1.13 console.log(Big(1.12).round(2, Big.roundUp).toNumber()); // 1.12
The text was updated successfully, but these errors were encountered:
Look first at the value of Big(quantityArs).div(exchangeRate) and then consider again whether the rounding is incorrect.
Big(quantityArs).div(exchangeRate)
Sorry, something went wrong.
No branches or pull requests
I'm expecting the result of the roundUp to be 1.12, but it returns wrongly 1.13.
The text was updated successfully, but these errors were encountered: