Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: Javascript Thousand Separator / string format
私の質問は次のとおりです。どうすれば数字を区切ることができますか/1000; だから私は"1243234"to"1 243 234" または"1000"to"1 000"などを作りたいです(私の英語でごめんなさい=/)
/1000
"1243234"
"1 243 234"
"1000"
"1 000"
> "1243234".replace(/\d(?=(\d{3})+$)/g, "$& ") "1 243 234"