Java Currency getNumericCodeAsString() MethodThe getNumericCodeAsString() is the method of Java Currency class which is used to get the 3 digit numeric code (as defined by ISO 4217) for the invoking currency as a String. For example, Numeric value of 20 would be returned as "020", and a numeric value of 1 would be returned as "001". SyntaxFollowing is the declaration of getNumericCodeAsString() method: Parameter
ReturnsThe getNumericCodeAsString() method returns the 3 digit numeric code (as defined by ISO 4217) for the invoking currency as a String. ExceptionsNA Compatibility VersionJava 9 and above Example 1Output: 044 - Bahamian Dollar 064 - Bhutanese Ngultrum 788 - Tunisian Dinar 051 - Armenian Dram 442 - Luxembourgian Franc 963 - Testing Currency Code 000 - French Gold Franc 952 - West African CFA Franc 970 - Colombian Real Value Unit 380 - Italian Lira 760 - Syrian Pound 784 - United Arab Emirates Dirham 524 - Nepalese Rupee 108 - Burundian Franc 144 - Sri Lankan Rupee 124 - Canadian Dollar 752 - Swedish Krona ... Example 2Output: Name: British Pound Sterling Numeric Code: 826 Example 3Output: Enter the numeric code which you want to search: 020 Currency with Numeric code 020 is found. Enter the numeric code which you want to search: 111 Currency with Numeric code 111 not found. Example 4Output: Enter the Currency: ADP Name: Andorran Peseta Numeric Code: 020 Next TopicJava-currency-getnumericcode-method |