LoginSignup
12
12

More than 5 years have passed since last update.

TextViewなどで日本円表記したい

Posted at

¥10,000こういうやつ

NumberFormatにそれらしいヤツがありました。

nikkei.java
NumberFormat.getCurrencyInstance().format(10000);

表示させてみると

¥10,000.00

日経平均かよ。

今回、銭はいりません。
なんかオプションないかなと思って見てみたけどなさそう。
なのでDecimalFormatというヤツをつかいました。

awesomeYen.java
DecimalFormat yenFormat = new DecimalFormat("\u00A5###,###");

yenFormat.format(10000);

やったね。

12
12
0

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
12
12