• R/O
  • SSH
  • HTTPS

aoiro: コミット


コミットメタ情報

リビジョン92 (tree)
日時2021-04-04 23:15:59
作者hirukawa_ryo

ログメッセージ

* aoiro 0.9.8
家事按分の計算でMath.floor(端数切捨て)をMath.round(丸め)に変更しました。Math.floorでは家事按分比率 80.0% のときに1円の誤差が出てしまいました。

変更サマリ

差分

--- aoiro/trunk/src/main/java/net/osdn/aoiro/AccountSettlement.java (revision 91)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/AccountSettlement.java (revision 92)
@@ -83,14 +83,14 @@
8383 }
8484 }
8585 if(debtorTotal > creditorTotal) {
86- double total = (debtorTotal - creditorTotal) * (1.0 - proportionalDivision.getBusinessRatio());
87- long longTotal = (long)Math.floor(total);
86+ double total = (debtorTotal - creditorTotal) * (1.0d - proportionalDivision.getBusinessRatio());
87+ long longTotal = Math.round(total);
8888 if(longTotal != 0) {
8989 creditors.add(new Creditor(proportionalDivision.getAccountTitle(), longTotal));
9090 }
9191 } else if(creditorTotal > debtorTotal) {
92- double total = (creditorTotal - debtorTotal) * (1.0 - proportionalDivision.getBusinessRatio());
93- long longTotal = (long)Math.floor(total);
92+ double total = (creditorTotal - debtorTotal) * (1.0d - proportionalDivision.getBusinessRatio());
93+ long longTotal = Math.round(total);
9494 if(longTotal != 0) {
9595 debtors.add(new Debtor(proportionalDivision.getAccountTitle(), longTotal));
9696 }
旧リポジトリブラウザで表示