diff --git a/app/utils/han-number.ts b/app/utils/han-number.ts index 8104aed..d021285 100644 --- a/app/utils/han-number.ts +++ b/app/utils/han-number.ts @@ -4,9 +4,11 @@ * Every interface language here is written in Han script and spells these the * same way, so the numeral is a formatting detail rather than a message of its * own: 三地同形 reads in Chinese exactly as 三つの字形 reads in Japanese. - * Anything past the handful of columns a row can have falls back to figures. */ -const HAN_DIGITS = ['〇', '一', '二', '三', '四', '五'] +const hanNumberFormat = new Intl.NumberFormat('zh', { + numberingSystem: 'hanidec', + useGrouping: false, +}) export const hanNumber = (value: number): string => - HAN_DIGITS[value] ?? String(value) + hanNumberFormat.format(value)