diff --git a/packages/loot-core/src/mocks/budget.js b/packages/loot-core/src/mocks/budget.js index 1439639..60e51b7 100644 --- a/packages/loot-core/src/mocks/budget.js +++ b/packages/loot-core/src/mocks/budget.js @@ -110,7 +110,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) { transactions.push(transaction); if (Math.random() < 0.2) { - let a = (transaction.amount / 3) | 0; + let a = Math.round(transaction.amount / 3); let pick = () => payee === incomePayee ? incomeGroup.categories.find(c => c.name === 'Income').id diff --git a/packages/loot-core/src/server/budget/actions.js b/packages/loot-core/src/server/budget/actions.js index e3201ca..fac045a 100644 --- a/packages/loot-core/src/server/budget/actions.js +++ b/packages/loot-core/src/server/budget/actions.js @@ -185,7 +185,7 @@ export async function set3MonthAvg({ month }) { 'sum-amount-' + cat.id ); - const avg = ((spent1 + spent2 + spent3) / 3) | 0; + const avg = Math.round((spent1 + spent2 + spent3) / 3); setBudget({ category: cat.id, month, amount: -avg }); } });