From 5ef91bbe40f23cac6ecdb6833e5c8c036cc2b769 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 18 Mar 2020 11:43:19 +0100 Subject: [PATCH] Update Utilities.js --- Utilities.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Utilities.js b/Utilities.js index 7878498c3..c29e0a4f1 100644 --- a/Utilities.js +++ b/Utilities.js @@ -241,7 +241,7 @@ function removeTime (datetime) { return dateOnly } -function printLabel (labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction) { +function printLabel (labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction, noDecimals) { let labelPoint if (color === undefined) { color = UI_COLOR.DARK } if (fontSize === undefined) { fontSize = 10 }; @@ -251,6 +251,9 @@ function printLabel (labelToPrint, x, y, opacity, fontSize, color, center, conta if (isNaN(label) === false && label !== '') { label = dynamicDecimals(labelToPrint) label = label.toLocaleString() + if (noDecimals === true) { + label = Math.trunc(label) + } } let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO