From e03b5726e11a57cc0edf6f69a1981bd2e49a435d Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 30 Jul 2019 12:03:21 +0530 Subject: [PATCH] style: linting fixes --- src/js/utils/draw-utils.js | 4 ++-- src/js/utils/draw.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/utils/draw-utils.js b/src/js/utils/draw-utils.js index 3388eb7..00a1bbf 100644 --- a/src/js/utils/draw-utils.js +++ b/src/js/utils/draw-utils.js @@ -48,8 +48,8 @@ export function shortenLargeNumber(label) { let p = Math.floor(Math.log10(Math.abs(number))); if (p <= 2) return number; // Return as is for a 3 digit number of less let l = Math.floor(p / 3); - let shortened = (Math.pow(10, p - l * 3) * +(number / Math.pow(10, p)).toFixed(1)) + let shortened = (Math.pow(10, p - l * 3) * +(number / Math.pow(10, p)).toFixed(1)); // Correct for floating point error upto 2 decimal places - return Math.round(shortened*100)/100 + ' ' + ['', 'K', 'M', 'B', 'T'][l];; + return Math.round(shortened*100)/100 + ' ' + ['', 'K', 'M', 'B', 'T'][l]; } \ No newline at end of file diff --git a/src/js/utils/draw.js b/src/js/utils/draw.js index 34907e5..506f3cf 100644 --- a/src/js/utils/draw.js +++ b/src/js/utils/draw.js @@ -319,7 +319,7 @@ function makeVertLine(x, label, y1, y2, options={}) { function makeHoriLine(y, label, x1, x2, options={}) { if(!options.stroke) options.stroke = BASE_LINE_COLOR; if(!options.lineType) options.lineType = ''; - if (options.shortenNumbers) label = shortenLargeNumber(label) + if (options.shortenNumbers) label = shortenLargeNumber(label); let className = 'line-horizontal ' + options.className + (options.lineType === "dashed" ? "dashed": "");