/** * Gets a custom <code>NumberFormat</code> instance for the default locale * using the specified pattern and currency code. * * @param pattern pattern for this formatter * @param currencyData currency data * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern, CurrencyData currencyData) { return new NumberFormat(pattern, currencyData, true); }
/** * Provides the global currency format for the current locale, using a * specified currency. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getGlobalCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.globalCurrencyPattern(), currencyData, false); }
/** * Provides the simple currency format for the current locale using a * specified currency. Note that these formats may be ambiguous if the * currency isn't clear from other content on the page. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getSimpleCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.simpleCurrencyPattern(), currencyData, false); }
/** * Provides the standard currency format for the current locale using a * specified currency. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.currencyPattern(), currencyData, false); }
/** * Gets a custom <code>NumberFormat</code> instance for the default locale * using the specified pattern and currency code. * * @param pattern pattern for this formatter * @param currencyCode international currency code * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid * or the currency code is unknown */ public static NumberFormat getFormat(String pattern, String currencyCode) { return new NumberFormat(pattern, lookupCurrency(currencyCode), true); }
/** * Gets a <code>NumberFormat</code> instance for the default locale using * the specified pattern and the default currencyCode. * * @param pattern pattern for this formatter * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern) { return new NumberFormat(pattern, CurrencyList.get().getDefault(), true); }
/** * Provides the standard scientific format for the default locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * scientific format for the default locale */ public static NumberFormat getScientificFormat() { if (cachedScientificFormat == null) { cachedScientificFormat = new NumberFormat( defaultNumberConstants.scientificPattern(), CurrencyList.get().getDefault(), false); } return cachedScientificFormat; }
/** * Provides the standard decimal format for the default locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * decimal format for the default locale */ public static NumberFormat getDecimalFormat() { if (cachedDecimalFormat == null) { cachedDecimalFormat = new NumberFormat( defaultNumberConstants.decimalPattern(), CurrencyList.get().getDefault(), false); } return cachedDecimalFormat; }
/** * Provides the standard percent format for the default locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * percent format for the default locale */ public static NumberFormat getPercentFormat() { if (cachedPercentFormat == null) { cachedPercentFormat = new NumberFormat( defaultNumberConstants.percentPattern(), CurrencyList.get().getDefault(), false); } return cachedPercentFormat; }
/** * Gets a custom <code>NumberFormat</code> instance for the default locale * using the specified pattern and currency code. * * @param pattern pattern for this formatter * @param currencyData currency data * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern, CurrencyData currencyData) { return new NumberFormat(pattern, currencyData, true); }
/** * Gets a custom <code>NumberFormat</code> instance for the default locale * using the specified pattern and currency code. * * @param pattern pattern for this formatter * @param currencyData currency data * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern, CurrencyData currencyData) { return new NumberFormat(pattern, currencyData, true); }
// Not correct Java! string meridianNess = (hours.getValue()/12==0?"AM":"PM"); int h = hours.getValue()%12; if (h==0) h = 12; System.out.print(h+":"+new NumberFormat("00").format(minutes.getValue())+":"+ new NumberFormat("00").format(seconds.getValue())+" "+meridianNess);
/** * Provides the standard currency format for the current locale using a * specified currency. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.currencyPattern(), currencyData, false); }
/** * Provides the global currency format for the current locale, using a * specified currency. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getGlobalCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.globalCurrencyPattern(), currencyData, false); }
/** * Provides the standard currency format for the current locale using a * specified currency. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.currencyPattern(), currencyData, false); }
/** * Provides the global currency format for the current locale, using a * specified currency. * * @param currencyData currency data to use * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getGlobalCurrencyFormat(CurrencyData currencyData) { return new NumberFormat(defaultNumberConstants.globalCurrencyPattern(), currencyData, false); }
/** * Gets a custom <code>NumberFormat</code> instance for the default locale * using the specified pattern and currency code. * * @param pattern pattern for this formatter * @param currencyCode international currency code * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid * or the currency code is unknown */ public static NumberFormat getFormat(String pattern, String currencyCode) { return new NumberFormat(pattern, lookupCurrency(currencyCode), true); }
/** * Gets a custom <code>NumberFormat</code> instance for the default locale * using the specified pattern and currency code. * * @param pattern pattern for this formatter * @param currencyCode international currency code * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid * or the currency code is unknown */ public static NumberFormat getFormat(String pattern, String currencyCode) { return new NumberFormat(pattern, lookupCurrency(currencyCode), true); }
/** * Gets a <code>NumberFormat</code> instance for the default locale using * the specified pattern and the default currencyCode. * * @param pattern pattern for this formatter * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern) { return new NumberFormat(pattern, CurrencyList.get().getDefault(), true); }
/** * Gets a <code>NumberFormat</code> instance for the default locale using * the specified pattern and the default currencyCode. * * @param pattern pattern for this formatter * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern) { return new NumberFormat(pattern, CurrencyList.get().getDefault(), true); }