Fix handling of -0 in budget summary (#229)
* Fix handling of -0 in budget summary * Update based on review Co-Authored-By: Tom French <15848336+TomAFrench@users.noreply.github.com>
This commit is contained in:
parent
f09f2dfe7b
commit
9e7f94a237
1 changed files with 3 additions and 5 deletions
|
@ -112,11 +112,9 @@ function TotalsList({ prevMonthName, collapsed }) {
|
|||
<CellValue
|
||||
binding={rolloverBudget.forNextMonth}
|
||||
formatter={value => {
|
||||
let n = parseInt(value);
|
||||
n = isNaN(n) ? 0 : -n;
|
||||
let v = format(n, 'financial');
|
||||
|
||||
return n > 0 ? '+' + v : n === 0 ? '-' + v : v;
|
||||
let n = parseInt(value) || 0;
|
||||
let v = format(Math.abs(n), 'financial');
|
||||
return n >= 0 ? '-' + v : '+' + v;
|
||||
}}
|
||||
style={[{ fontWeight: 600 }, styles.tnum]}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue