Java Currency getNumericCode() Method

8 Nov 2024 | 2 min read

The getNumericCode() is the method of Java Currency class which is used to get the numeric code (as defined by ISO 4217) for the invoking currency.

Syntax

Following is the declaration of getNumericCode() method:

Parameter

DataTypeParameterDescription
NANAThis method does not accept any parameter.

Returns

The getNumericCode() method returns the numeric code (as defined by ISO 4217) for the invoking currency.

Exceptions

NA

Compatibility Version

Java 1.7 and above

Example 1

Output:

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

Example 2

Output:

Name: British Pound Sterling Numeric Code: 826 

Example 3

Output:

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. 

Example 4

Output:

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