Format Gauge and SingleStat number values
parent
54d7f4468c
commit
1ee81dd2ad
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue