java.util.Currency.getDisplayName()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中java.util.Currency.getDisplayName()方法的一些代码示例,展示了Currency.getDisplayName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Currency.getDisplayName()方法的具体详情如下:
包路径:java.util.Currency
类名称:Currency
方法名:getDisplayName

Currency.getDisplayName介绍

[英]Equivalent to getDisplayName(Locale.getDefault()). See "Be wary of the default locale".
[中]

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: knowm/XChange

  1. this.name = name;
  2. } else if (javaCurrency != null) {
  3. this.name = javaCurrency.getDisplayName();
  4. } else {
  5. this.name = commonCode;

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: org.apidesign.bck2brwsr/emul

  1. /**
  2. * Gets the name that is suitable for displaying this currency for
  3. * the default locale. If there is no suitable display name found
  4. * for the default locale, the ISO 4217 currency code is returned.
  5. *
  6. * @return the display name of this currency for the default locale
  7. * @since 1.7
  8. */
  9. public String getDisplayName() {
  10. return getDisplayName(Locale.getDefault(Locale.Category.DISPLAY));
  11. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: jtulach/bck2brwsr

  1. /**
  2. * Gets the name that is suitable for displaying this currency for
  3. * the default locale. If there is no suitable display name found
  4. * for the default locale, the ISO 4217 currency code is returned.
  5. *
  6. * @return the display name of this currency for the default locale
  7. * @since 1.7
  8. */
  9. public String getDisplayName() {
  10. return getDisplayName(Locale.getDefault(Locale.Category.DISPLAY));
  11. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Equivalent to {@code getDisplayName(Locale.getDefault())}.
  3. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  4. * @since 1.7
  5. */
  6. public String getDisplayName() {
  7. return getDisplayName(Locale.getDefault());
  8. }

代码示例来源:origin: Erudika/para

  1. @Override
  2. public String getCurrencyName(String cur, Locale locale) {
  3. if (cur != null && currencyToLocaleMap.containsKey(cur.toUpperCase())) {
  4. return Currency.getInstance(cur.toUpperCase()).getDisplayName((locale == null ? Locale.US : locale));
  5. } else {
  6. return "";
  7. }
  8. }

代码示例来源:origin: stackoverflow.com

  1. String userInput = "250.00 SEK";
  2. String[] parts = userInput.split(" ");
  3. Currency currency = Currency.getInstance(parts[1]);
  4. System.out.print(currency.getDisplayName());

代码示例来源:origin: stackoverflow.com

  1. static public void displayCurrency( Locale currentLocale) {
  2. Double currencyAmount = new Double(9876543.21);
  3. Currency currentCurrency = Currency.getInstance(currentLocale);
  4. NumberFormat currencyFormatter =
  5. NumberFormat.getCurrencyInstance(currentLocale);
  6. System.out.println(
  7. currentLocale.getDisplayName() + ", " +
  8. currentCurrency.getDisplayName() + ": " +
  9. currencyFormatter.format(currencyAmount));
  10. }

代码示例来源:origin: stackoverflow.com

  1. String userInput = "250.00 SEK";
  2. final Set<Currency> availableCurrencies = Currency.getAvailableCurrencies();
  3. for (Currency availableCurrency : availableCurrencies) {
  4. final String currencyCode = availableCurrency.getCurrencyCode();
  5. final String displayName = availableCurrency.getDisplayName();
  6. if (userInput.contains(currencyCode)){
  7. System.out.println("Currency is " + availableCurrency.getDisplayName());
  8. }
  9. }

代码示例来源:origin: stackoverflow.com

  1. static public void displayCurrency( Locale currentLocale) {
  2. Double currencyAmount = new Double(9876543.21);
  3. Currency currentCurrency = Currency.getInstance(currentLocale);
  4. NumberFormat currencyFormatter =
  5. NumberFormat.getCurrencyInstance(currentLocale);
  6. System.out.println(
  7. currentLocale.getDisplayName() + ", " +
  8. currentCurrency.getDisplayName() + ": " +
  9. currencyFormatter.format(currencyAmount));
  10. }

代码示例来源:origin: stackoverflow.com

  1. Double currencyAmount = new Double(9876543.21);
  2. Currency currentCurrency = Currency.getInstance(currentLocale);
  3. NumberFormat currencyFormatter =
  4. NumberFormat.getCurrencyInstance(currentLocale);
  5. System.out.println(
  6. currentLocale.getDisplayName() + ", " +
  7. currentCurrency.getDisplayName() + ": " +
  8. currencyFormatter.format(currencyAmount));

代码示例来源:origin: stackoverflow.com

  1. Set<Currency> avail = Currency.getAvailableCurrencies();
  2. for (Currency next : avail) {
  3. System.out.println("----------------------------------------");
  4. System.out.println("displayName="+next.getDisplayName());
  5. System.out.println("currencyCode="+next.getCurrencyCode());
  6. System.out.println("numericCode="+next.getNumericCode());
  7. System.out.println("symbol="+next.getSymbol());
  8. System.out.println("toString="+next.toString());
  9. System.out.println("----------------------------------------");
  10. }

代码示例来源:origin: com.tcdng.unify/unify-core

  1. @Override
  2. protected List<ListData> create(Locale locale, Object... params) throws Exception {
  3. List<ListData> list = new ArrayList<ListData>();
  4. for (Currency currency : Currency.getAvailableCurrencies()) {
  5. list.add(new ListData(currency.getCurrencyCode(), currency.getDisplayName(locale)));
  6. }
  7. DataUtils.sort(list, ListData.class, "listDescription", true);
  8. return list;
  9. }

代码示例来源:origin: stackoverflow.com

  1. Set<Currency> currencies = Currency.getAvailableCurrencies();
  2. for (Currency currency: currencies) {
  3. System.out.printf("%s\t%s\t%s\n",currency.getDisplayName(), currency.getSymbol(), currency.toString());
  4. // your code to check whether the symbol is not empty here
  5. // add it to your String array or just directly use the
  6. // CharSequences arrays for entries and values here.
  7. }

代码示例来源:origin: com.tcdng.unify/unify-core

  1. @Override
  2. public List<? extends Listable> execute(Locale locale, CurrencyListParams params) throws UnifyException {
  3. if (params.isCurrencyCodes()) {
  4. List<ListData> list = new ArrayList<ListData>();
  5. for (String currencyCode : params.getCurrencyCodes()) {
  6. Currency currency = Currency.getInstance(currencyCode);
  7. list.add(new ListData(currency.getCurrencyCode(), currency.getDisplayName(locale)));
  8. }
  9. DataUtils.sort(list, ListData.class, "listDescription", true);
  10. return list;
  11. }
  12. return currencyListByLocale.get(locale);
  13. }

相关文章