/** * {@icu} Returns a currency format for the specified locale. * @return a number format for currency * @stable ICU 3.2 */ public static NumberFormat getCurrencyInstance(ULocale inLocale) { return getInstance(inLocale, CURRENCYSTYLE); }
/** * {@icu} Returns a general-purpose number format for the specified locale. * @stable ICU 3.2 */ public static NumberFormat getNumberInstance(ULocale inLocale) { return getInstance(inLocale, NUMBERSTYLE); }
@Override public DecimalFormat call() throws Exception { return (DecimalFormat) NumberFormat.getInstance(locale, NumberFormat.PLURALCURRENCYSTYLE); } });
/** * {@icu} Returns the default number format for the specified locale. * The default format is one of the styles provided by the other * factory methods: getNumberInstance, getCurrencyInstance or getPercentInstance. * Exactly which one is locale-dependent. * @stable ICU 3.2 */ public static NumberFormat getInstance(ULocale inLocale) { return getInstance(inLocale, NUMBERSTYLE); }
/** * {@icu} Returns a scientific format for the specified locale. * @return a scientific number format * @stable ICU 3.2 */ public static NumberFormat getScientificInstance(ULocale inLocale) { return getInstance(inLocale, SCIENTIFICSTYLE); }
/** * {@icu} Returns a percentage format for the specified locale. * @return a number format for percents * @stable ICU 3.2 */ public static NumberFormat getPercentInstance(ULocale inLocale) { return getInstance(inLocale, PERCENTSTYLE); }
/** * {@icu} Returns a scientific format for the specified locale. * @return a scientific number format * @stable ICU 3.2 */ public static NumberFormat getScientificInstance(ULocale inLocale) { return getInstance(inLocale, SCIENTIFICSTYLE); }
/** * {@icu} Returns a currency format for the specified locale. * @return a number format for currency * @stable ICU 3.2 */ public static NumberFormat getCurrencyInstance(ULocale inLocale) { return getInstance(inLocale, CURRENCYSTYLE); }
/** * Returns a currency format for the specified locale. * @return a number format for currency * @stable ICU 2.0 */ public static NumberFormat getCurrencyInstance(Locale inLocale) { return getInstance(ULocale.forLocale(inLocale), CURRENCYSTYLE); }
/** * {@icu} Returns a scientific format for the current default locale. * @return a scientific number format * @stable ICU 2.0 */ public final static NumberFormat getScientificInstance() { return getInstance(ULocale.getDefault(Category.FORMAT), SCIENTIFICSTYLE); }
/** * Returns the default number format for the current default locale. * The default format is one of the styles provided by the other * factory methods: getNumberInstance, getIntegerInstance, * getCurrencyInstance or getPercentInstance. * Exactly which one is locale-dependent. * @stable ICU 2.0 */ //Bug 4408066 [Richard/GCL] public final static NumberFormat getInstance() { return getInstance(ULocale.getDefault(Category.FORMAT), NUMBERSTYLE); }
/** * Create a format from the locale, formatWidth, and format. * * @param locale the locale. * @param formatWidth hints how long formatted strings should be. * @return The new MeasureFormat object. * @stable ICU 53 */ public static MeasureFormat getInstance(ULocale locale, FormatWidth formatWidth) { return getInstance(locale, formatWidth, NumberFormat.getInstance(locale)); }
/** * Returns a currency format for the current default <code>FORMAT</code> locale. * @return a number format for currency * @see Category#FORMAT * @stable ICU 2.0 */ public final static NumberFormat getCurrencyInstance() { return getInstance(ULocale.getDefault(Category.FORMAT), CURRENCYSTYLE); }
/** * Returns a percentage format for the specified locale. * @return a number format for percents * @stable ICU 2.0 */ public static NumberFormat getPercentInstance(Locale inLocale) { return getInstance(ULocale.forLocale(inLocale), PERCENTSTYLE); }
/** * Returns a general-purpose number format for the specified locale. * @stable ICU 2.0 */ public static NumberFormat getNumberInstance(Locale inLocale) { return getInstance(ULocale.forLocale(inLocale), NUMBERSTYLE); }
/** * Returns a percentage format for the current default locale. * @return a number format for percents * @stable ICU 2.0 */ public final static NumberFormat getPercentInstance() { return getInstance(ULocale.getDefault(Category.FORMAT), PERCENTSTYLE); }
/** * Returns the default number format for the specified locale. * The default format is one of the styles provided by the other * factory methods: getNumberInstance, getCurrencyInstance or getPercentInstance. * Exactly which one is locale-dependent. * @stable ICU 2.0 */ public static NumberFormat getInstance(Locale inLocale) { return getInstance(ULocale.forLocale(inLocale), NUMBERSTYLE); }
/** * {@icu} Returns a specific style number format for default locale. * @param style number format style * @stable ICU 4.2 */ public final static NumberFormat getInstance(int style) { return getInstance(ULocale.getDefault(Category.FORMAT), style); }
/** * Returns a percentage format for the current default locale. * @return a number format for percents * @stable ICU 2.0 */ public final static NumberFormat getPercentInstance() { return getInstance(ULocale.getDefault(Category.FORMAT), PERCENTSTYLE); }
@Override public Number parseNumber(String locale, String value) throws ParseException { ULocale closestLocale = findClosestULocale(locale); NumberFormat nf = NumberFormat.getInstance(closestLocale); return nf.parse(value); } }