mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
use truncation instead of rounding down or rounding to the nearest value when numerical calculations exceed precision limits
This commit is contained in:
@@ -260,7 +260,7 @@ export const useStatisticsStore = defineStore('statistics', () => {
|
||||
continue;
|
||||
}
|
||||
|
||||
amount = Math.floor(finalAmount);
|
||||
amount = Math.trunc(finalAmount);
|
||||
}
|
||||
|
||||
if (account.isLiability) {
|
||||
@@ -481,7 +481,7 @@ export const useStatisticsStore = defineStore('statistics', () => {
|
||||
const amount = exchangeRatesStore.getExchangedAmount(item.amount, item.account.currency, defaultCurrency);
|
||||
|
||||
if (isNumber(amount)) {
|
||||
item.amountInDefaultCurrency = Math.floor(amount);
|
||||
item.amountInDefaultCurrency = Math.trunc(amount);
|
||||
}
|
||||
} else if (item.account && item.account.currency === defaultCurrency) {
|
||||
item.amountInDefaultCurrency = item.amount;
|
||||
|
||||
Reference in New Issue
Block a user