]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Check for isNaN before building number formatter options (#11238)
authorRoman Shtylman <shtylman@gmail.com>
Wed, 19 Apr 2023 22:22:25 +0000 (15:22 -0700)
committerGitHub <noreply@github.com>
Wed, 19 Apr 2023 22:22:25 +0000 (18:22 -0400)
commitb16f32afcaa8749e8a395d3989bc654f3d7ed4f6
treef0c58e61fcb2eb83d1f5dabd65ee3a40c19eda19
parentb34e273880e3a4fbbb1609bb1827986f179ca061
Check for isNaN before building number formatter options (#11238)

* Check for isNaN before building number formatter options

When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits will make the number formatter throw. Instead we check for isNaN and use a fallback value so the formatter does not throw.

* Update src/core/core.ticks.js

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
---------

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
src/core/core.ticks.js