Instead of limiting currency decimal places to 2 only, we allow them to float between 2 to 3, to avoid from losing precision.
1.1 --- a/docs/changelog.txt Mon Nov 29 04:22:32 2010 +0000
1.2 +++ b/docs/changelog.txt Tue Dec 14 00:09:00 2010 +0800
1.3 @@ -1,6 +1,10 @@
1.4 This file summarizes changes in JStock releases.
1.5 Numbers in parentheses refer to SourceForge.net tracker item numbers (#XXXXX)
1.6
1.7 +JStock ?.?.?? - ????-??-??
1.8 + Bugfix: Instead of limiting currency decimal places to 2 only, we allow them
1.9 + to float between 2 to 3, to avoid from losing precision.
1.10 +
1.11 JStock 1.0.5w - 2010-11-26
1.12 Bugfix: If we perform server re-connecting explicitly, there might be chance
1.13 where the entire stock database will be corrupted due to empty stock
2.1 --- a/src/org/yccheok/jstock/portfolio/Utils.java Mon Nov 29 04:22:32 2010 +0000
2.2 +++ b/src/org/yccheok/jstock/portfolio/Utils.java Tue Dec 14 00:09:00 2010 +0800
2.3 @@ -45,7 +45,9 @@
2.4 // Use ThreadLocal to ensure thread safety.
2.5 private static final ThreadLocal <NumberFormat> numberFormat = new ThreadLocal <NumberFormat>() {
2.6 @Override protected NumberFormat initialValue() {
2.7 - return new DecimalFormat("#,##0.00");
2.8 + // Instead of limiting currency decimal places to 2 only, we allow
2.9 + // them to float between 2 to 3, to avoid from losing precision.
2.10 + return new DecimalFormat("#,##0.00#");
2.11 }
2.12 };
2.13