fix: use Math.round in place of truncating digits
This commit is contained in:
parent
bb9c9927db
commit
04aa1731b5
2 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,7 @@ async function fillPrimaryChecking(handlers, account, payees, groups) {
|
||||||
transactions.push(transaction);
|
transactions.push(transaction);
|
||||||
|
|
||||||
if (Math.random() < 0.2) {
|
if (Math.random() < 0.2) {
|
||||||
let a = (transaction.amount / 3) | 0;
|
let a = Math.round(transaction.amount / 3);
|
||||||
let pick = () =>
|
let pick = () =>
|
||||||
payee === incomePayee
|
payee === incomePayee
|
||||||
? incomeGroup.categories.find(c => c.name === 'Income').id
|
? incomeGroup.categories.find(c => c.name === 'Income').id
|
||||||
|
|
|
@ -185,7 +185,7 @@ export async function set3MonthAvg({ month }) {
|
||||||
'sum-amount-' + cat.id
|
'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 });
|
setBudget({ category: cat.id, month, amount: -avg });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue