1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

jQuery:所得した値を3桁カンマ(金額)で区切る方法

Last updated at Posted at 2025-09-09

困ったこと

const UnitPrice = $p.getValue('NumN') || "No Entered";
↓
800000.00000

やりたいこと

これを
800,000
という表示にしたい

解決

const UnitPriceNum = $p.getValue('NumN') || "No Entered";
const UnitPrice = Number(UnitPriceNum).toLocaleString();
↓
800,000

解説

Javascriptでは、取得した値はテキスト型のため、数値型に変換
Number()

3桁カンマ区切りに変換・小数点切り捨て
().toLocaleString()

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?