Here you can find the source of getCurrency(final String code)
Parameter | Description |
---|---|
code | string with a currency code |
public static Currency getCurrency(final String code)
//package com.java2s; /*/*from w w w . j a v a 2 s . c o m*/ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ import java.util.Currency; public class Main { /** * @param code string with a currency code * @return a Currency initialized from the parameter code */ public static Currency getCurrency(final String code) { return Currency.getInstance(code); } /** * Gets the currency code from the parameter Currency. * @param currency Currency to use * @return the string with the currency code * @since 6.4 */ public static String getCurrency(final Currency currency) { return currency.getCurrencyCode(); } }