친성의 블로그
HomeArchivesCategoriesTagsAboutProject
  • 태그
  • toLocaleString
2021-09-04 게시 됨2021-09-04 업데이트 됨javascript몇 초안에 읽기 (약 56 단어)

js number comma

example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
const n = 11111111111111;
console.log(n.toLocaleString());
// 11,111,111,111,111

// console.log(navigator.languages);
}

{
const n = 11111111111111;
const nuberWithCommas = n.toLocaleString('ko-KR');
console.log(nuberWithCommas);
// 11,111,111,111,111
}

참고

  • https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript
  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString

south korea

포스트

481

카테고리

31

태그

415

카테고리

  • aws34
  • bash5
  • blog35
  • blog history18
  • cmd13
  • docker5
  • electron3
  • eslint2
  • etc33
  • git34
  • java11
  • javascript36
  • keyword15
  • markdown5
  • nestjs1
  • nodejs29
  • playlist4
  • programmers24
  • python5
  • react24
  • reg exp4
  • sql12
  • swift2
  • telegram1
  • typeorm1
  • typescript15
  • using api3
  • vscode37
  • web58
  • windows8
  • 생각4

아카이브

  • 5월 20221
  • 4월 20221
  • 3월 20227
  • 2월 20224
  • 1월 202220
  • 12월 20216
  • 11월 202111
  • 10월 202113
  • 9월 202118
  • 8월 202134
  • 7월 202136
  • 6월 202130
  • 5월 202111
  • 4월 202121
  • 3월 202114
  • 2월 202112
  • 1월 202114
  • 12월 202032
  • 11월 202080
  • 10월 202039
  • 9월 202077

광고

친성의 블로그

© 2023 chinsung  Powered by Hexo & Icarus

×