화폐 (1) 썸네일형 리스트형 숫자를 화폐 형식으로 표현해보자! Date.prototype.toLocaleString() 활용하기 toLocalString() 메소드를 이용하면 화폐 단위를 손쉽게 나타낼 수 있다. 해당 메소드는 매개변수로 locales, options 두 가지를 갖는다. Intl.DateTimeFormat() 생성자의 매개변수와 일치한다. locales 에는 화폐 단위를 정하고, options 에는 출력 형식을 지정한다. 🌝 예시 const number = 123456.789; // request a currency format console.log(number.toLocaleString('de-DE', { style: 'currency', currency: 'EUR' })); // → 123.456,79 € // the Japanese yen do.. 이전 1 다음