概要
毎回JSで数値を金額表記へフォーマットするやり方を忘れてググっているので、今回は忘れないためにここにメモ
やり方
const formatter = new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }); formatter.format(10000); // => "¥10,000"
毎回JSで数値を金額表記へフォーマットするやり方を忘れてググっているので、今回は忘れないためにここにメモ
const formatter = new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }); formatter.format(10000); // => "¥10,000"