Skip to content

Commit c0c1f8b

Browse files
committed
fix: prevent infinite loop
1 parent 471d73b commit c0c1f8b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/charting/utils/Utils.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,7 @@ export namespace Utils {
275275
*/
276276
export function getDecimals(number) {
277277
const i = roundToNextSignificant(number);
278-
279-
if (!Number.isFinite(i)) return 0;
280-
278+
if (!Number.isFinite(i) || i === 0) return 0;
281279
return Math.ceil(-Math.log10(i)) + 2;
282280
}
283281

0 commit comments

Comments
 (0)