小编Hab*_*bib的帖子

使用“NumberFormat”类 Java 进行国家/地区货币格式化

我目前正在执行一项任务,涉及获取代表一笔钱的双精度数字,并使用 NumberFormat 类的 getCurrencyInstance 方法将其转换为美国、印度、中国和法国的货币格式。

\n

输入:

\n
A single double-precision number denoting 'payment'\n
Run Code Online (Sandbox Code Playgroud)\n

输出:

\n
On the first line, print US: 'u' where 'u' is 'payment' formatted for US currency.\nOn the second line, print India: 'i' where 'i' is 'payment' formatted for the Indian currency.\nOn the third line, print China: 'c' where 'c' is 'payment' formatted for Chinese currency.\nOn the fourth line, print France: 'f' where 'f' is formatted for French currency.\n
Run Code Online (Sandbox Code Playgroud)\n

输入示例:

\n
12324.134\n
Run Code Online (Sandbox Code Playgroud)\n

示例输出: …

java printing currency class currency-formatting

2
推荐指数
1
解决办法
253
查看次数

标签 统计

class ×1

currency ×1

currency-formatting ×1

java ×1

printing ×1