From 026bb67c64e6c38de2a450e5a7f98b111634a783 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 28 Dec 2019 13:59:31 -0600 Subject: [PATCH] Fix "undefined" appearing when rendering small numbers --- numbers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numbers.js b/numbers.js index ea82366..082f39a 100644 --- a/numbers.js +++ b/numbers.js @@ -6,7 +6,7 @@ function numberTextSmall(val, places = 1, smallPlaces = 0) { if (isNaN(val)) { throw new RangeError("Invalid number: " + val); } - if (val < Math.pow(10, (places+2))) { + if (val < Math.pow(10, (places+3))) { return round(val, smallPlaces); } @@ -26,7 +26,7 @@ function numberText(val, places = 1, smallPlaces = 0) { if (isNaN(val)) { throw new RangeError("Invalid number: " + val); } - if (val < Math.pow(10, (places+2))) { + if (val < Math.pow(10, (places+3))) { return round(val, smallPlaces); }