Skip to content

Commit

Permalink
updates getMaxOfDataSeries in create-app template to handle case when…
Browse files Browse the repository at this point in the history
… cost is zero | Dan
  • Loading branch information
dtoakley committed Dec 17, 2021
1 parent c6c1939 commit 0cdcd2c
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -69,11 +69,12 @@ const sumServiceTotals = (

export const getMaxOfDataSeries = (series: cloudEstPerDay[]): number => {
if (series.length === 0) return 1
return Math.max(
const max = Math.max(
...series.map((dataPair) => {
return dataPair.y
}),
)
return max ? max : 1
}

const roundNumberBasedOnSize = (number: number, digits: number): number => {
Expand Down

0 comments on commit 0cdcd2c

Please sign in to comment.