use truncation instead of rounding down or rounding to the nearest value when numerical calculations exceed precision limits

This commit is contained in:
MaysWind
2025-09-09 20:46:51 +08:00
parent d4603a1892
commit 7e2e1a4ad3
13 changed files with 36 additions and 36 deletions
+2 -2
View File
@@ -164,13 +164,13 @@ export const useOverviewStore = defineStore('overview', () => {
const expenseAmount = exchangeRatesStore.getExchangedAmount(amount.expenseAmount, amount.currency, defaultCurrency);
if (isNumber(incomeAmount)) {
totalIncomeAmount += Math.floor(incomeAmount);
totalIncomeAmount += Math.trunc(incomeAmount);
} else {
hasUnCalculatedTotalIncome = true;
}
if (isNumber(expenseAmount)) {
totalExpenseAmount += Math.floor(expenseAmount);
totalExpenseAmount += Math.trunc(expenseAmount);
} else {
hasUnCalculatedTotalExpense = true;
}