LoginSignup
2
0

More than 1 year has passed since last update.

[JavaScript]数字をカンマ区切りにすることができる地味に便利な機能

Posted at

toLocaleString()

toLocalString()は数字をカンマ区切りにし、文字列に変換します。

toLocaleString.js
let a = 10000;
console.log(a.toLocaleString());
//'10,000'とカンマ区切りで表示される

let b = 1000.12;
console.log(b.toLocaleString());
//'1,000.12'と表示
2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0