Package com.ibm.icu.text

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


            "0.0",
            "#000.0"         
        };
       
        for(int i=0; i < patterns.length; i++) {
            df.applyPattern(patterns[i]);
            numstr = df.format(5);       
            try {
                Number n = df.parse(numstr);
                logln("INFO: Parsed " + numstr + " -> " + n);
            } catch (ParseException pe) {
View Full Code Here


            } catch (ParseException pe) {
                errln("ERROR: Failed round trip with strict parsing.");
            }          
        }
       
        df.applyPattern(patterns[1]);
        numstr = "005";       
        try {
            Number n = df.parse(numstr);
            errln("ERROR: Expected round trip failure not encountered: numstr -> " + n);
        } catch (ParseException pe) {
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormat.applyPattern(String)'
     */
    public void testApplyPattern() {
        DecimalFormat df = new DecimalFormat("#,##0.##");
        df.applyPattern("#,0.#");
        assertEquals("1,2,3.4", df.format(123.4));
    }

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormat.applyLocalizedPattern(String)'
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.