Skip to content

Commit

Permalink
Merge pull request #963 from cmu-delphi/sgratzl/bugfix_trend
Browse files Browse the repository at this point in the history
fix: trend change for 0 base value
  • Loading branch information
sgratzl authored Jun 24, 2021
2 parents 4c2e97a + d0d0bc0 commit 2798c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/trend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function computeChangeDelta(v?: number, base?: number) {
if (v === base) {
return { change: 0, delta: 0 };
}
if (base == null) {
if (base == null || base === 0) {
return { change: 1, delta: v ?? 0 };
}
if (v == null) {
Expand Down

0 comments on commit 2798c28

Please sign in to comment.