formatLongNumber

This commit is contained in:
Minseo Lee 2024-08-29 16:30:27 +09:00
parent 4e07e70941
commit 0d387a6d90
3 changed files with 17 additions and 29 deletions

View file

@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { httpGet, setItem } from 'next-basics';
import { LOCALE_CONFIG } from 'lib/constants';
import { getDateLocale, getTextDirection } from 'lib/lang';
import { getDateLocale, getTextDirection, getMaxInt } from 'lib/lang';
import useStore, { setLocale } from 'store/app';
import { useForceUpdate } from './useForceUpdate';
@ -14,6 +14,7 @@ export function useLocale() {
const forceUpdate = useForceUpdate();
const dir = getTextDirection(locale);
const dateLocale = getDateLocale(locale);
const maxInt = getMaxInt(locale);
async function loadMessages(locale: string) {
const { ok, data } = await httpGet(
@ -56,7 +57,7 @@ export function useLocale() {
}
}, []);
return { locale, saveLocale, messages, dir, dateLocale };
return { locale, saveLocale, messages, dir, dateLocale, maxInt };
}
export default useLocale;