Skip to content
Snippets Groups Projects
Unverified Commit 9e7f94a2 authored by Jed Fox's avatar Jed Fox Committed by GitHub
Browse files

Fix handling of -0 in budget summary (#229)


* Fix handling of -0 in budget summary

* Update based on review

Co-Authored-By: default avatarTom French <15848336+TomAFrench@users.noreply.github.com>
parent f09f2dfe
No related branches found
No related tags found
No related merge requests found
...@@ -112,11 +112,9 @@ function TotalsList({ prevMonthName, collapsed }) { ...@@ -112,11 +112,9 @@ function TotalsList({ prevMonthName, collapsed }) {
<CellValue <CellValue
binding={rolloverBudget.forNextMonth} binding={rolloverBudget.forNextMonth}
formatter={value => { formatter={value => {
let n = parseInt(value); let n = parseInt(value) || 0;
n = isNaN(n) ? 0 : -n; let v = format(Math.abs(n), 'financial');
let v = format(n, 'financial'); return n >= 0 ? '-' + v : '+' + v;
return n > 0 ? '+' + v : n === 0 ? '-' + v : v;
}} }}
style={[{ fontWeight: 600 }, styles.tnum]} style={[{ fontWeight: 600 }, styles.tnum]}
/> />
......
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