๐ย Reference
๐ย Chapter
,)๋ฅผ ์ฐ์ด์ค๋ค.// 1. ํ๊ตญ ์ํ ํ์
const won = new Intl.NumberFormat('ko-KR', {
style: 'currency',
currency: 'KRW',
}).format(1250000);
// ์ถ๋ ฅ: "โฉ1,250,000"
// 2. ์์์ ๋ฐ ๋ฐฑ๋ถ์จ
const percent = new Intl.NumberFormat('en-US', {
style: 'percent',
minimumFractionDigits: 2,
}).format(0.123456);
// ์ถ๋ ฅ: "12.35%" (๋ฐ์ฌ๋ฆผ ํฌํจ)
// 3. ๋จ์ ํ์ (๋ฌด๊ฒ, ๊ธธ์ด ๋ฑ)
const unit = new Intl.NumberFormat('ko-KR', {
style: 'unit',
unit: 'kilometer',
}).format(50);
// ์ถ๋ ฅ: "50km"