リビジョン | 92 (tree) |
---|---|
日時 | 2021-04-04 23:15:59 |
作者 | hirukawa_ryo |
* aoiro 0.9.8
家事按分の計算でMath.floor(端数切捨て)をMath.round(丸め)に変更しました。Math.floorでは家事按分比率 80.0% のときに1円の誤差が出てしまいました。
@@ -83,14 +83,14 @@ | ||
83 | 83 | } |
84 | 84 | } |
85 | 85 | 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); | |
88 | 88 | if(longTotal != 0) { |
89 | 89 | creditors.add(new Creditor(proportionalDivision.getAccountTitle(), longTotal)); |
90 | 90 | } |
91 | 91 | } 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); | |
94 | 94 | if(longTotal != 0) { |
95 | 95 | debtors.add(new Debtor(proportionalDivision.getAccountTitle(), longTotal)); |
96 | 96 | } |