Format Gauge and SingleStat number values

pull/10616/head
Andrew Watkins 2018-07-05 16:32:16 -07:00
parent 54d7f4468c
commit 1ee81dd2ad
2 changed files with 3 additions and 2 deletions

View File

@ -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)
}

View File

@ -71,8 +71,9 @@ class SingleStat extends PureComponent<Props> {
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 {