Skip to content

Commit 8c3ebcf

Browse files
authored
fix(chart) :: drop unreachable branch
The check `> 10` and NaN (a 3 char string) cannot both hold at the same time. Removes the branch and sets `maximumFractionDigits: 2`.
1 parent a5aaa16 commit 8c3ebcf

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎frontend/src/apexcharts.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,9 @@ const sqlpage_chart = (() => {
281281
return d.toLocaleDateString();
282282
return d.toLocaleString();
283283
}
284-
const str_val = value.toLocaleString();
285-
if (str_val.length > 10 && Number.isNaN(value))
286-
return value.toFixed(2);
287-
return str_val;
284+
return value.toLocaleString(undefined, {
285+
maximumFractionDigits: 2,
286+
});
288287
},
289288
},
290289
},

0 commit comments

Comments
 (0)