Skip to content
Snippets Groups Projects
Unverified Commit a3e3c78c authored by shall0pass's avatar shall0pass Committed by GitHub
Browse files

Goals: Improve remainder calculation when combined with other keywords (#1288)

parent 927c8594
No related branches found
No related tags found
No related merge requests found
......@@ -603,9 +603,16 @@ async function applyCategoryTemplate(
break;
}
case 'remainder': {
to_budget = Math.round(remainder_scale * template.weight);
// can over budget with the rounding, so checking that
if (to_budget > budgetAvailable) to_budget = budgetAvailable;
if (remainder_scale >= 0) {
to_budget +=
remainder_scale === 0
? Math.round(template.weight)
: Math.round(remainder_scale * template.weight);
// can over budget with the rounding, so checking that
if (to_budget >= budgetAvailable + budgeted) {
to_budget = budgetAvailable + budgeted;
}
}
break;
}
case 'error':
......
---
category: Bugfix
authors: [shall0pass]
---
Goals: Improved calculation when 'remainder' keyword is used with other keywords in the same category.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment