Skip to content

Commit 5fc9e99

Browse files
authored
fix(i18n): format compare sparkline data labels (#2537)
1 parent 0ca1692 commit 5fc9e99

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/components/Chart/SplitSparkline.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const props = defineProps<{
3131
3232
const { locale } = useI18n()
3333
const colorMode = useColorMode()
34+
const numberFormatter = useNumberFormatter({
35+
maximumFractionDigits: 0,
36+
})
3437
const resolvedMode = shallowRef<'light' | 'dark'>('light')
3538
const rootEl = shallowRef<HTMLElement | null>(null)
3639
const palette = getPalette('')
@@ -153,6 +156,9 @@ const configs = computed(() => {
153156
fontSize: 24,
154157
bold: false,
155158
color: colors.value.fg,
159+
formatter: ({ value }) => {
160+
return numberFormatter.value.format(value)
161+
},
156162
datetimeFormatter: {
157163
enable: true,
158164
locale: locale.value,

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ function handleModalTransitioned() {
6060
}
6161
6262
const { fetchPackageDownloadEvolution } = useCharts()
63-
const numberFormatter = useNumberFormatter()
63+
const numberFormatter = useNumberFormatter({
64+
maximumFractionDigits: 0,
65+
})
6466
6567
const { accentColors, selectedAccentColor } = useAccentColor()
6668

0 commit comments

Comments
 (0)