Home
last modified time | relevance | path

Searched refs:currency (Results 1 – 9 of 9) sorted by relevance

/libcore/luni/src/test/java/libcore/java/util/
DCurrencyTest.java39 Currency currency = Currency.getInstance("DEM"); in test_getSymbol_locale() local
40 assertEquals("DEM", currency.getSymbol(Locale.FRANCE)); in test_getSymbol_locale()
41 assertEquals("DM", currency.getSymbol(Locale.GERMANY)); in test_getSymbol_locale()
42 assertEquals("DEM", currency.getSymbol(Locale.US)); in test_getSymbol_locale()
51 Currency currency = Currency.getInstance("DEM"); in test_getSymbol_noLocaleArgument() local
55 assertEquals("DM", currency.getSymbol()); in test_getSymbol_noLocaleArgument()
83 Currency currency = Currency.getInstance("CHF"); in test_getDisplayName_locale_chf() local
84 assertEquals("Swiss Franc", currency.getDisplayName(Locale.US)); in test_getDisplayName_locale_chf()
85 assertEquals("Schweizer Franken", currency.getDisplayName(new Locale("de", "CH"))); in test_getDisplayName_locale_chf()
86 assertEquals("franc suisse", currency.getDisplayName(new Locale("fr", "CH"))); in test_getDisplayName_locale_chf()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DDecimalFormatSymbolsTest.java118 Currency currency = Currency.getInstance("USD"); in test_getCurrency() local
120 dfsUS.getCurrency(), currency); in test_getCurrency()
295 Currency currency = Currency.getInstance("JPY"); in test_setCurrencyLjava_util_Currency() local
296 dfs.setCurrency(currency); in test_setCurrencyLjava_util_Currency()
298 assertTrue("Returned incorrect currency", currency == dfs.getCurrency()); in test_setCurrencyLjava_util_Currency()
299 assertEquals("Returned incorrect currency symbol", currency.getSymbol( in test_setCurrencyLjava_util_Currency()
301 assertTrue("Returned incorrect international currency symbol", currency in test_setCurrencyLjava_util_Currency()
371 Currency currency = Currency.getInstance("JPY"); in test_setInternationalCurrencySymbolLjava_lang_String() local
372 dfs.setInternationalCurrencySymbol(currency.getCurrencyCode()); in test_setInternationalCurrencySymbolLjava_lang_String()
374 assertTrue("Test1: Returned incorrect currency", currency == dfs in test_setInternationalCurrencySymbolLjava_lang_String()
[all …]
DDecimalFormatTest.java1891 Currency currency = Currency.getInstance("AED"); in test_setCurrency() local
1892 df.setCurrency(currency); in test_setCurrency()
1893 assertTrue("Returned incorrect currency", currency == df.getCurrency()); in test_setCurrency()
1894 assertEquals("Returned incorrect currency symbol", currency.getSymbol(locale), in test_setCurrency()
1896 assertEquals("Returned incorrect international currency symbol", currency.getCurrencyCode(), in test_setCurrency()
/libcore/ojluni/src/main/java/java/text/
DDecimalFormatSymbols.java402 public void setCurrencySymbol(String currency) in setCurrencySymbol() argument
404 currencySymbol = currency; in setCurrencySymbol()
439 currency = null; in setInternationalCurrencySymbol()
442 currency = Currency.getInstance(currencyCode); in setInternationalCurrencySymbol()
443 currencySymbol = currency.getSymbol(locale); in setInternationalCurrencySymbol()
459 return currency; in getCurrency()
474 public void setCurrency(Currency currency) { in setCurrency() argument
475 if (currency == null) { in setCurrency()
478 this.currency = currency; in setCurrency()
479 intlCurrencySymbol = currency.getCurrencyCode(); in setCurrency()
[all …]
DDecimalFormat.java1397 public void setCurrency(Currency currency) { in setCurrency() argument
1400 if (currency != symbols.getCurrency() in setCurrency()
1401 || !currency.getSymbol().equals(symbols.getCurrencySymbol())) { in setCurrency()
1402 symbols.setCurrency(currency); in setCurrency()
1469 Currency currency = symbols.getCurrency(); in adjustForCurrencyDefaultFractionDigits() local
1470 if (currency == null) { in adjustForCurrencyDefaultFractionDigits()
1472 currency = Currency.getInstance(symbols.getInternationalCurrencySymbol()); in adjustForCurrencyDefaultFractionDigits()
1476 if (currency != null) { in adjustForCurrencyDefaultFractionDigits()
1477 int digits = currency.getDefaultFractionDigits(); in adjustForCurrencyDefaultFractionDigits()
DNumberFormat.java781 public void setCurrency(Currency currency) { in setCurrency() argument
/libcore/ojluni/src/main/java/java/util/
DCurrency.java166 Currency currency = getInstance(icuCurrency.getCurrencyCode()); in getAvailableCurrencies() local
167 if (currency == null) { in getAvailableCurrencies()
168 currency = new Currency(icuCurrency); in getAvailableCurrencies()
169 instances.put(currency.currencyCode, currency); in getAvailableCurrencies()
171 available.add(currency); in getAvailableCurrencies()
/libcore/luni/src/test/java/libcore/java/text/
DDecimalFormatTest.java296 Currency currency = Currency.getInstance("CNY"); in testSetCurrency_symbolOrigin() local
299 String locale1Symbol = currency.getSymbol(locale1); in testSetCurrency_symbolOrigin()
300 String locale2Symbol = currency.getSymbol(locale2); in testSetCurrency_symbolOrigin()
309 formatArbitraryCurrencyAmountInLocale(currency, locale2); in testSetCurrency_symbolOrigin()
313 formatArbitraryCurrencyAmountInLocale(currency, locale2); in testSetCurrency_symbolOrigin()
333 private String formatArbitraryCurrencyAmountInLocale(Currency currency, Locale locale) { in formatArbitraryCurrencyAmountInLocale() argument
335 localeCurrencyFormat.setCurrency(currency); in formatArbitraryCurrencyAmountInLocale()
/libcore/luni/src/main/native/
Dlibcore_icu_ICU.cpp151 …ScopedResourceBundle currency(ures_getByKey(currencyMap.get(), countryCode.c_str(), NULL, &status)… in ICU_getCurrencyCode() local
156 ScopedResourceBundle currencyElem(ures_getByIndex(currency.get(), 0, NULL, &status)); in ICU_getCurrencyCode()