From 60b345f59c99729885b1d68efc0100ac73a63387 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 11 Aug 2017 04:52:51 -0700 Subject: [PATCH] util: revert to old toFixed behavior. --- lib/utils/util.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils/util.js b/lib/utils/util.js index 90e7cdbf..84dd6c86 100644 --- a/lib/utils/util.js +++ b/lib/utils/util.js @@ -855,6 +855,9 @@ util.toFixed = function toFixed(num, exp) { assert(lo.length <= exp, 'Invalid integer value.'); if (lo.length === 0) + lo = '0'; + + if (exp === 0) return `${sign}${hi}`; return `${sign}${hi}.${lo}`;