Commit fd7007e
committed
Avoid Price.toString() failing for certain values of numerator/denominator.
Fixes a regression introduced in 66cc533 (bugfix #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 #196
https://fabric.io/gnucash/android/apps/org.gnucash.android/issues/571b4a95ffcdc04250f98ba01 parent c0d00e1 commit fd7007e
2 files changed
Lines changed: 23 additions & 1 deletion
File tree
- app/src
- main/java/org/gnucash/android/model
- test/java/org/gnucash/android/test/unit/model
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
55 | 76 | | |
56 | 77 | | |
57 | 78 | | |
| |||
0 commit comments