/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
/** * Creates a valid CurrencyNode given a locale. * * @param locale Locale to create a CurrencyNode for * @return The new CurrencyNode */ public static CurrencyNode buildNode(final Locale locale) { DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale); Currency c = symbols.getCurrency(); CurrencyNode node = new CurrencyNode(); node.setSymbol(c.getCurrencyCode()); node.setPrefix(symbols.getCurrencySymbol()); node.setScale((byte) c.getDefaultFractionDigits()); return node; }
@Override public String toString() { return this.getClass().getName() + '{' + " Currency: " + formatSymbols.getCurrency() + ',' + " currencySymbol: " + formatSymbols.getCurrencySymbol() + ',' + " decimalSeparator: " + formatSymbols.getDecimalSeparator() + ',' + " digit: " + formatSymbols.getDigit() + ',' + " exponentSeparator: " + formatSymbols.getExponentSeparator() + ',' + " groupingSeparator: " + formatSymbols.getGroupingSeparator() + ',' + " infinity: " + formatSymbols.getInfinity() + ',' + " internationalCurrencySymbol: " + formatSymbols.getInternationalCurrencySymbol() + ',' + " minusSign: " + formatSymbols.getMinusSign() + ',' + " monetaryDecimalSeparator: " + formatSymbols.getMonetaryDecimalSeparator() + ',' + " naN: " + formatSymbols.getNaN() + ',' + " patternSeparator: " + formatSymbols.getPatternSeparator() + ',' + " percent: " + formatSymbols.getPercent() + ',' + " perMill: " + formatSymbols.getPerMill() + ',' + " zeroDigit: " + formatSymbols.getZeroDigit() + '}'; } }
/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
icuDecfs = fIcuDecfmt.getDecimalFormatSymbols(); Currency currency = newSymbols.getCurrency(); if (currency == null) { icuDecfs.setCurrency(null);
/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
/** * Returns the currency used by this decimal format. * * @return the currency used by this decimal format. * @see DecimalFormatSymbols#getCurrency() */ @Override public Currency getCurrency() { return symbols.getCurrency(); }
/** * Gets the currency used by this decimal format when formatting * currency values. * The currency is obtained by calling * {@link DecimalFormatSymbols#getCurrency DecimalFormatSymbols.getCurrency} * on this number format's symbols. * * @return the currency used by this decimal format, or <code>null</code> * @since 1.4 */ public Currency getCurrency() { return symbols.getCurrency(); }
/** * Gets the currency used by this decimal format when formatting * currency values. * The currency is obtained by calling * {@link DecimalFormatSymbols#getCurrency DecimalFormatSymbols.getCurrency} * on this number format's symbols. * * @return the currency used by this decimal format, or <code>null</code> * @since 1.4 */ public Currency getCurrency() { return symbols.getCurrency(); }
/** * Returns the currency symbol, for JDK 1.4 compatibility only. * ICU clients should use the Currency API directly. * @return the currency used, or null * @stable ICU 3.4 */ public Currency getCurrency() { return new Currency(dfs.getCurrency()); }
/** * Get the currency unit. * @return the currency unit */ public CurrencyUnit getCurrency() { return Monetary.getCurrency(formatSymbols.getCurrency().getCurrencyCode()); }
/** * Returns the currency symbol, for JDK 1.4 compatibility only. * ICU clients should use the Currency API directly. * @return the currency used, or null * @stable ICU 3.4 */ public Currency getCurrency() { return new Currency(dfs.getCurrency()); }
String LocaleCountry = new Locale("en").getDefault().getCountry(); String LocaleLanguage = new Locale("en").getDefault().getLanguage(); String LocaleCurrency = new DecimalFormatSymbols().getCurrency().toString(); String LocaleShortDateTimePattern =new SimpleDateFormat().toPattern(); char LocaleDecimalSeparator = new DecimalFormatSymbols().getDecimalSeparator(); char LocaleThousandSeparator = new DecimalFormatSymbols().getGroupingSeparator(); String LocaleThousandGrouping = String.format("%d;0", new DecimalFormat().getMaximumFractionDigits()); String LocaleNegativePrefix = new DecimalFormat().getNegativePrefix(); String LocaleNegativeSuffix =new DecimalFormat().getNegativeSuffix(); String Operator = Utils.getQwnername(context);
/** * Sets the currency used by this number format when formatting * currency values. This does not update the minimum or maximum * number of fraction digits used by the number format. * The currency is set by calling * {@link DecimalFormatSymbols#setCurrency DecimalFormatSymbols.setCurrency} * on this number format's symbols. * * @param currency the new currency to be used by this decimal format * @exception NullPointerException if <code>currency</code> is null * @since 1.4 */ public void setCurrency(Currency currency) { if (currency != symbols.getCurrency()) { symbols.setCurrency(currency); if (isCurrencyFormat) { expandAffixes(); } } }
/** * Sets the currency used by this number format when formatting * currency values. This does not update the minimum or maximum * number of fraction digits used by the number format. * The currency is set by calling * {@link DecimalFormatSymbols#setCurrency DecimalFormatSymbols.setCurrency} * on this number format's symbols. * * @param currency the new currency to be used by this decimal format * @exception NullPointerException if <code>currency</code> is null * @since 1.4 */ public void setCurrency(Currency currency) { if (currency != symbols.getCurrency()) { symbols.setCurrency(currency); if (isCurrencyFormat) { expandAffixes(); } } }
/** * Adjusts the minimum and maximum fraction digits to values that * are reasonable for the currency's default fraction digits. */ void adjustForCurrencyDefaultFractionDigits() { Currency currency = symbols.getCurrency(); if (currency == null) { try { currency = Currency.getInstance(symbols.getInternationalCurrencySymbol()); } catch (IllegalArgumentException e) { } } if (currency != null) { int digits = currency.getDefaultFractionDigits(); if (digits != -1) { int oldMinDigits = getMinimumFractionDigits(); // Common patterns are "#.##", "#.00", "#". // Try to adjust all of them in a reasonable way. if (oldMinDigits == getMaximumFractionDigits()) { setMinimumFractionDigits(digits); setMaximumFractionDigits(digits); } else { setMinimumFractionDigits(Math.min(digits, oldMinDigits)); setMaximumFractionDigits(digits); } } } }
/** * Adjusts the minimum and maximum fraction digits to values that * are reasonable for the currency's default fraction digits. */ void adjustForCurrencyDefaultFractionDigits() { Currency currency = symbols.getCurrency(); if (currency == null) { try { currency = Currency.getInstance(symbols.getInternationalCurrencySymbol()); } catch (IllegalArgumentException e) { } } if (currency != null) { int digits = currency.getDefaultFractionDigits(); if (digits != -1) { int oldMinDigits = getMinimumFractionDigits(); // Common patterns are "#.##", "#.00", "#". // Try to adjust all of them in a reasonable way. if (oldMinDigits == getMaximumFractionDigits()) { setMinimumFractionDigits(digits); setMaximumFractionDigits(digits); } else { setMinimumFractionDigits(Math.min(digits, oldMinDigits)); setMaximumFractionDigits(digits); } } } }