From 1ee81dd2ad155da758e70aabeb2f1d0b97e69f0c Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Thu, 5 Jul 2018 16:32:16 -0700 Subject: [PATCH] Format Gauge and SingleStat number values --- ui/src/shared/components/Gauge.js | 2 +- ui/src/shared/components/SingleStat.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/shared/components/Gauge.js b/ui/src/shared/components/Gauge.js index 784c67208e..0371d09a31 100644 --- a/ui/src/shared/components/Gauge.js +++ b/ui/src/shared/components/Gauge.js @@ -290,7 +290,7 @@ class Gauge extends Component { ctx.textAlign = 'center' const textY = radius - const textContent = `${prefix}${gaugePosition.toString()}${suffix}` + const textContent = `${prefix}${gaugePosition.toLocaleString()}${suffix}` ctx.fillText(textContent, 0, textY) } diff --git a/ui/src/shared/components/SingleStat.tsx b/ui/src/shared/components/SingleStat.tsx index 4066257817..1b0d659e55 100644 --- a/ui/src/shared/components/SingleStat.tsx +++ b/ui/src/shared/components/SingleStat.tsx @@ -71,8 +71,9 @@ class SingleStat extends PureComponent { const lastValue = lastValues[firstAlphabeticalindex] const HUNDRED = 100.0 const roundedValue = Math.round(+lastValue * HUNDRED) / HUNDRED + const localeFormatted = roundedValue.toLocaleString() - return `${roundedValue}` + return `${localeFormatted}` } private get containerStyle(): CSSProperties {