Package com.ibm.icu.text

Examples of com.ibm.icu.text.NumberFormat.format()


    public String formatNumber(double number, Locale locale) {
        if (locale == null) {
            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getNumberInstance(locale);
        return nf.format(number);
    }

    @Override
    public String formatNumber(Integer number, Locale locale) {
        if (number == null) {
View Full Code Here


            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getNumberInstance(locale);
        nf.setMinimumFractionDigits(minFractionDigits);
        nf.setMaximumFractionDigits(maxFractionDigits);
        return nf.format(number);
    }

    @Override
    public String formatPercent(double percent) {
        return formatPercent(percent, null);
View Full Code Here

    public String formatPercent(double percent, Locale locale) {
        if (locale == null) {
            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getPercentInstance(locale);
        return nf.format(percent);
    }

    @Override
    public String formatPercent(double percent, Locale locale, int minFractionDigits, int maxFractionDigits) {
        if (locale == null) {
View Full Code Here

            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getPercentInstance(locale);
        nf.setMinimumFractionDigits(minFractionDigits);
        nf.setMaximumFractionDigits(maxFractionDigits);
        return nf.format(percent);
    }

    @Override
    public String formatCurrency(double currency) {
        return formatCurrency(currency, null);
View Full Code Here

        }
        if (locale == null) {
            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getNumberInstance(locale);
        return nf.format(number);
    }

    @Override
    public String formatNumber(BigDecimal number, Locale locale, int minFractionDigits, int maxFractionDigits) {
        if (number == null) {
View Full Code Here

            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getNumberInstance(locale);
        nf.setMinimumFractionDigits(minFractionDigits);
        nf.setMaximumFractionDigits(maxFractionDigits);
        return nf.format(number);
    }

    @Override
    public BigDecimal parseBigDecimal(String number) throws ParseException {
        return parseBigDecimal(number, null);
View Full Code Here

        }
        if (locale == null) {
            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        NumberFormat nf = NumberFormat.getNumberInstance(locale);
        return nf.format(number);
    }

    @Override
    public String formatNumber(Number number, Locale locale, int minFractionDigits, int maxFractionDigits) {
        if (number == null) {
View Full Code Here

        }

        NumberFormat nf = NumberFormat.getNumberInstance(locale);
        nf.setMinimumFractionDigits(minFractionDigits);
        nf.setMaximumFractionDigits(maxFractionDigits);
        return nf.format(number);
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.