Merge pull request #120 from ReflectsLight/bug/eastern_numerals
Display eastern arabic numerals on Iridium / OpenBSD
This commit is contained in:
commit
d9f611deb2
1 changed files with 4 additions and 1 deletions
|
@ -34,7 +34,10 @@ export function i18n(json: string): TFunction {
|
|||
}
|
||||
|
||||
export function formatNumber(number: number, locale: Quran.Locale): string {
|
||||
return number.toLocaleString(locale, { maximumFractionDigits: 1 })
|
||||
const numLocale = locale === 'ar' ? 'ar-SA' : locale;
|
||||
const options = { maximumFractionDigits: 1 };
|
||||
return new Intl.NumberFormat(numLocale, options)
|
||||
.format(number)
|
||||
.split(/([^\d])/)
|
||||
.join(' ');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue