Package com.ibm.icu.text

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


     * Test method for 'com.ibm.icu.text.DecimalFormat.toLocalizedPattern()'
     */
    public void testToLocalizedPattern() {
        DecimalFormat df = new DecimalFormat("#,##0.##", new DecimalFormatSymbols(Locale.FRANCE));
        assertEquals("#,##0.##", df.toPattern());
        assertEquals("#\u00a0##0,##", df.toLocalizedPattern());
    }

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormat.applyPattern(String)'
     */
 
View Full Code Here


        builder.put(IS_EASTERN_NAME_STYLE, al.isEasternNameStyle());

        // DecimalFormat is expected
        DecimalFormat df = (DecimalFormat) DecimalFormat.getNumberInstance(al.getNumberLocale());

        builder.put(NUMBER_FORMAT, df.toLocalizedPattern());
        DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();
        builder.put(DECIMAL, dfs.getDecimalSeparator());
        builder.put(GROUPING, dfs.getGroupingSeparator());
        builder.put(ZERO_DIGIT, dfs.getZeroDigit());
View Full Code Here

        builder.put(GROUPING, dfs.getGroupingSeparator());
        builder.put(ZERO_DIGIT, dfs.getZeroDigit());

        df = (DecimalFormat) DecimalFormat.getPercentInstance(al.getNumberLocale());

        builder.put(PERCENT_FORMAT, df.toLocalizedPattern());

        df = (DecimalFormat) DecimalFormat.getCurrencyInstance(al.getCurrencyLocale());

        builder.put(CURRENCY_FORMAT, df.toLocalizedPattern());
        DecimalFormatSymbols cdfs = df.getDecimalFormatSymbols();
View Full Code Here

        builder.put(PERCENT_FORMAT, df.toLocalizedPattern());

        df = (DecimalFormat) DecimalFormat.getCurrencyInstance(al.getCurrencyLocale());

        builder.put(CURRENCY_FORMAT, df.toLocalizedPattern());
        DecimalFormatSymbols cdfs = df.getDecimalFormatSymbols();
        Currency cur = cdfs.getCurrency();
        builder.put(CURRENCY_CODE, cur != null ? cur.getCurrencyCode() : "");
        builder.put(CURRENCY, cdfs.getCurrencySymbol());
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.