通話中の番号をローカライズするString.format
のと同じ方法は可能NumberFormat.format
ですか?
私はそれが単に使用することを期待していました
String.format(locale, "%d", number)
しかし、これは と同じ結果を返しませんNumberFormat
。例えば:
String.format(Locale.GERMAN, "%d", 1234567890)
与えます:「1234567890」、一方
NumberFormat.getNumberInstance(Locale.GERMAN).format(1234567890)
与える:「1.234.567.890」
それができない場合、数字を含むテキストをローカライズするための推奨される方法は何ですか?