Java Currency getNumericCode() 方法

2024年11月8日 | 2 分钟阅读

getNumericCode()Java Currency 类 的一个方法,用于获取调用该货币的数字代码(根据 ISO 4217 标准定义)。

语法

以下是 getNumericCode() 方法的声明:

参数

数据类型参数描述
不适用不适用此方法不接受任何参数。

返回值

getNumericCode() 方法返回调用货币的数字代码(根据 ISO 4217 标准定义)。

异常

不适用

兼容版本

Java 1.7 及以上版本

示例 1

输出

230 - Ethiopian Birr
188 - Costa Rican Colón
132 - Cape Verdean Escudo
934 - Turkmenistani Manat
20 - Andorran Peseta
292 - Gibraltar Pound
970 - COU
975 - Bulgarian Lev
932 - Zimbabwean Dollar (2009)
344 - Hong Kong Dollar
214 - Dominican Peso
634 - Qatari Rial
...

示例 2

输出

Name: British Pound Sterling
Numeric Code: 826

示例 3

输出

Enter the numeric code which you want to search: 356
Currency with Numeric code 356 is found.

Enter the numeric code which you want to search: 111
Currency with Numeric code 111 not found.

示例 4

输出

Enter the Currency: INR
Name: Indian Rupee
Numeric Code: 356