Skip to content

Commit

Permalink
configure number formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Jun 22, 2024
1 parent 7dce8d2 commit 233da78
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ export const datetimeFormats: I18nOptions['datetimeFormats'] = {
}
}
};

export const numberFormats: I18nOptions['numberFormats'] = {
[Locale.EN]: {
percent: {
style: 'percent', useGrouping: false
}
},
[Locale.DE]: {
percent: {
style: 'percent', useGrouping: false
}
}
}
3 changes: 2 additions & 1 deletion frontend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createApp } from 'vue';
import { createI18n } from 'vue-i18n';
import App from './App.vue';
import './css/fonts.css';
import { Locale, datetimeFormats, messages } from './i18n/index';
import { Locale, datetimeFormats, messages, numberFormats } from './i18n/index';
import './index.css';
import router from './router';
// migrate to // import messages from '@intlify/vite-plugin-vue-i18n/messages'; as soon as it works
Expand All @@ -12,6 +12,7 @@ const i18n = createI18n({
fallbackLocale: Locale.EN,
messages,
datetimeFormats,
numberFormats,
globalInjection: true,
missingWarn: false,
fallbackWarn: false
Expand Down

0 comments on commit 233da78

Please sign in to comment.