/** * Provides the standard currency format for the current locale using a * specified currency. * * @param currencyCode valid currency code, as defined in * com.google.gwt.i18n.client.constants.CurrencyCodeMapConstants.properties * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale * @throws IllegalArgumentException if the currency code is unknown */ public static NumberFormat getCurrencyFormat(String currencyCode) { return getCurrencyFormat(lookupCurrency(currencyCode)); }
/** * Provides the standard currency format for the current locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the default locale */ public static NumberFormat getCurrencyFormat() { if (cachedCurrencyFormat == null) { cachedCurrencyFormat = getCurrencyFormat(CurrencyList.get().getDefault()); } return cachedCurrencyFormat; }
@Override public final Double parse(final CharSequence pobject) throws ParseException { if (StringUtils.isEmpty(Objects.toString(pobject))) { return null; } try { return Double.valueOf(NumberFormat.getCurrencyFormat().parse(pobject.toString())); } catch (final NumberFormatException e) { throw new ParseException(e.getMessage(), 0); // NOPMD, we needn't a stack trace } } }
public CurrencyKeyPressHandler() { super(NumberFormat.getCurrencyFormat().format(1234567890.0123456789) + NumberFormat.getCurrencyFormat().format(-1234567890.0123456789), true); } }
@Override public String render(final Double pobject) { if (pobject == null) { return StringUtils.EMPTY; } return NumberFormat.getCurrencyFormat().format(pobject); } }
@Override public final Double parse(final CharSequence pobject) throws ParseException { if (StringUtils.isEmpty(Objects.toString(pobject))) { return null; } try { return Double.valueOf(NumberFormat.getCurrencyFormat().parse(pobject.toString())); } catch (final NumberFormatException e) { throw new ParseException(e.getMessage(), 0); // NOPMD, we needn't a stack trace } } }
/** * Provides the standard currency format for the current locale using a * specified currency. * * @param currencyCode valid currency code, as defined in * com.google.gwt.i18n.client.constants.CurrencyCodeMapConstants.properties * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale * @throws IllegalArgumentException if the currency code is unknown */ public static NumberFormat getCurrencyFormat(String currencyCode) { return getCurrencyFormat(lookupCurrency(currencyCode)); }
/** * Provides the standard currency format for the default locale. * * @param value the value * @return the currency value */ public static String currency(double value) { return NumberFormat.getCurrencyFormat().format(value); }
@Override public final BigDecimal parse(final CharSequence pobject) throws ParseException { if (StringUtils.isEmpty(Objects.toString(pobject))) { return null; } try { return BigDecimal.valueOf(NumberFormat.getCurrencyFormat().parse(pobject.toString())); } catch (final NumberFormatException e) { throw new ParseException(e.getMessage(), 0); // NOPMD, we needn't a stack trace } } }
public CurrencyKeyPressHandler() { super(NumberFormat.getCurrencyFormat().format(1234567890.0123456789) + NumberFormat.getCurrencyFormat().format(-1234567890.0123456789), true); } }
@Override public String render(final BigDecimal pobject) { if (pobject == null) { return StringUtils.EMPTY; } return NumberFormat.getCurrencyFormat().format(pobject); } }
@Override public String render(final Double pobject) { if (pobject == null) { return StringUtils.EMPTY; } return NumberFormat.getCurrencyFormat().format(pobject); } }
@Override public final BigDecimal parse(final CharSequence pobject) throws ParseException { if (StringUtils.isEmpty(Objects.toString(pobject))) { return null; } try { return BigDecimal.valueOf(NumberFormat.getCurrencyFormat().parse(pobject.toString())); } catch (final NumberFormatException e) { throw new ParseException(e.getMessage(), 0); // NOPMD, we needn't a stack trace } } }
@Override public String render(final BigDecimal pobject) { if (pobject == null) { return StringUtils.EMPTY; } return NumberFormat.getCurrencyFormat().format(pobject); } }
/** * Provides the standard currency format for the current locale using a * specified currency. * * @param currencyCode valid currency code, as defined in * com.google.gwt.i18n.client.constants.CurrencyCodeMapConstants.properties * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale * @throws IllegalArgumentException if the currency code is unknown */ public static NumberFormat getCurrencyFormat(String currencyCode) { return getCurrencyFormat(lookupCurrency(currencyCode)); }
/** * Provides the standard currency format for the current locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the default locale */ public static NumberFormat getCurrencyFormat() { if (cachedCurrencyFormat == null) { cachedCurrencyFormat = getCurrencyFormat(CurrencyList.get().getDefault()); } return cachedCurrencyFormat; }
/** * Provides the standard currency format for the current locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the default locale */ public static NumberFormat getCurrencyFormat() { if (cachedCurrencyFormat == null) { cachedCurrencyFormat = getCurrencyFormat(CurrencyList.get().getDefault()); } return cachedCurrencyFormat; }