Here you can find the source of getLocalSymbol(Currency currency)
Parameter | Description |
---|---|
currency | the currency to get the local symbol |
public static String getLocalSymbol(Currency currency)
//package com.java2s; /*/* w ww . j a v a 2 s. c om*/ * Copyright (c) 2012, Mayocat <hello@mayocat.org> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.util.Currency; import java.util.Locale; import java.util.SortedMap; public class Main { public static SortedMap<Currency, Locale> currencyLocaleMap; /** * Always returns the local symbol (for example $ or the euro symbol) of a currency, whatever the locale of the * system is. * * @param currency the currency to get the local symbol * @return the local symbol for the passed currency */ public static String getLocalSymbol(Currency currency) { return currencyLocaleMap.containsKey(currency) ? currency.getSymbol(currencyLocaleMap.get(currency)) : currency.getSymbol(); } }