Package com.ibm.icu.text

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


            verify(message, resultStr, result[i++]);
            message = "";
            resultStr = "";

            //for -2.55 with RoundingIncrement=1.0
            resultStr = pat.format(Roundingnumber1);
            message = "round(" + (double) Roundingnumber1
                    + "," + mode + ",FALSE) with RoundingIncrement=1.0==>";
            verify(message, resultStr, result[i++]);
            message = "";
            resultStr = "";
View Full Code Here


    public String formatCurrency(double currency, Locale locale) {
        if (locale == null) {
            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        DecimalFormat df = (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
        return df.format(currency);
    }

    @Override
    public String formatCurrency(double value, Locale locale, int minFractionDigits, int maxFractionDigits) {
        return formatCurrency(value, locale, minFractionDigits, maxFractionDigits, null);
View Full Code Here

        // setCurrency will set fraction digits based on locale so that statement needs to happen before if we
        // want to set fraction digits ourselves
        df.setCurrency(currency);
        df.setMinimumFractionDigits(minFractionDigits);
        df.setMaximumFractionDigits(maxFractionDigits);
        return df.format(value);
    }

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

        if (locale == null) {
            locale = Aura.getLocalizationAdapter().getAuraLocale().getNumberLocale();
        }
        DecimalFormat df = (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
        df.setParseBigDecimal(true);
        return df.format(currency);
    }

    @Override
    public String formatCurrency(BigDecimal value, Locale locale, int minFractionDigits, int maxFractionDigits) {
        return formatCurrency(value, locale, minFractionDigits, maxFractionDigits, null);
View Full Code Here

        DecimalFormat df = (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
        df.setParseBigDecimal(true);
        df.setCurrency(currency);
        df.setMinimumFractionDigits(minFractionDigits);
        df.setMaximumFractionDigits(maxFractionDigits);
        return df.format(value);
    }

    @Override
    public Date parseDate(String date) throws ParseException {
        return parseDate(date, null, null, DateFormat.DEFAULT);
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.