Skip to content
New issue

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

Avoid Price.toString() failing for certain values of numerator/denominator. #498

Conversation

rivaldi8
Copy link
Collaborator

Fixes a regression introduced in 66cc533 (bugfix #479) in which the numerator/denominator division fails with an ArithmeticException if no MathContext is provided. Somehow I missed it when moving code around.

Fixes Crashlitics issue #196

…nator.

Fixes a regression introduced in 66cc533 (bugfix codinguser#479) in which the
numerator/denominator division fails with an ArithmeticException if no
MathContext is provided. BigDecimal tries to return an exact result,
which is not possible when rounding and precision aren't specified.

See BigDecimal javadoc:
http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html

Fixes Crashlitics issue codinguser#196
https://fabric.io/gnucash/android/apps/org.gnucash.android/issues/571b4a95ffcdc04250f98ba0
@@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rivaldi8 Thanks for the pr.
This version upgrade breaks the build, because it depends on a higher version of gradle.
We will upgrade for the 2.1.x series. But 2.0.x should stay with build tools 1.5.0

@rivaldi8 rivaldi8 force-pushed the fix-arithmeticexception-in-price branch from 469314a to fd7007e Compare April 26, 2016 19:04
@rivaldi8
Copy link
Collaborator Author

Ok, I've updated the pull request dropping the commit.

@codinguser codinguser merged commit df9a06e into codinguser:hotfix/patches Apr 26, 2016
@rivaldi8 rivaldi8 deleted the fix-arithmeticexception-in-price branch May 23, 2016 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants