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
Is the test below correct? I expect quotient should have scale 2 because MonetaryContext of the dividend limits it.
@Test public void maxScaleOnDivide() { MonetaryContext mc = MonetaryContextBuilder.of().setMaxScale(2).setPrecision(64).set(RoundingMode.CEILING).build(); MonetaryAmount dividend = Monetary.getDefaultAmountFactory().setContext(mc).setNumber(100).setCurrency("EUR").create(); MonetaryAmount quotient = dividend.divide(3); assertEquals(quotient.getContext().getMaxScale(), 2); assertEquals(quotient.getNumber().numberValue(BigDecimal.class), BigDecimal.valueOf(33.33)); }
At the moment it fails with:
Expected :2 Actual :-1
on first assertion and
Expected :33.33 Actual :33.33333333333333333333333333333333333333333333333333333333333334
on second.
The text was updated successfully, but these errors were encountered:
Fixed in 1.2
Sorry, something went wrong.
No branches or pull requests
Is the test below correct? I expect quotient should have scale 2 because MonetaryContext of the dividend limits it.
At the moment it fails with:
on first assertion and
on second.
The text was updated successfully, but these errors were encountered: