Package com.ibm.icu.text

Examples of com.ibm.icu.text.DecimalFormatSymbols


                    uFormat = new SimpleDateFormat(pattern, locale);
                    ((SimpleDateFormat) uFormat).setTimeZone(TimeZone.getTimeZone("GMT"));
                    uFormat.format(new DateTimeValue(1995, 7, 3, 2, 59, 12, 123).getObjectToFormat());
                    break;
                case NUMBER:
                    DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
                    uFormat = new DecimalFormat(pattern, symbols);
                    uFormat.format(new NumberValue(-12.3).getObjectToFormat());
                    break;
            }
        }
View Full Code Here


    }

    public void TestDeprecatedCurrencyFormat() {
        // bug 5952
        Locale locale = new Locale("sr", "QQ");
        DecimalFormatSymbols icuSymbols = new
        com.ibm.icu.text.DecimalFormatSymbols(locale);
        String symbol = icuSymbols.getCurrencySymbol();
        Currency currency = icuSymbols.getCurrency();
        String expectCur = null;
        String expectSym = "\u00A4";
        if(!symbol.toString().equals(expectSym) || currency != null) {
            errln("for " + locale + " expected " + expectSym+"/"+expectCur + " but got " + symbol+"/"+currency);
        } else {
View Full Code Here

        private SimpleTimeZone stz = new SimpleTimeZone(0, "");
        private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd EEE HH:mm:ss", ULocale.US);
        private DecimalFormat decf;

        public DumpFormatter() {
            DecimalFormatSymbols decfs = new DecimalFormatSymbols(ULocale.US);
            decf = new DecimalFormat("00", decfs);
        }
View Full Code Here

        return symbols;
    }
   
    private static DecimalFormatSymbols getCannedDecimalFormatSymbols(ULocale uloc)
    {
        DecimalFormatSymbols dfs = new DecimalFormatSymbols(uloc);
       
        setSymbols(dfs, (String[]) cannedDecimalFormatSymbols.get(uloc.toString()));
       
        return dfs;
    }
View Full Code Here

    public static class DecimalFormatSymbolsHandler implements SerializableTest.Handler
    {
        public Object[] getTestObjects()
        {
            Locale locales[] = SerializableTest.getLocales();
            DecimalFormatSymbols dfs[] = new DecimalFormatSymbols[locales.length];
           
            for (int i = 0; i < locales.length; i += 1) {
                ULocale uloc = ULocale.forLocale(locales[i]);

                dfs[i] = getCannedDecimalFormatSymbols(uloc);
View Full Code Here

            return dfs;
        }
       
        public boolean hasSameBehavior(Object a, Object b)
        {
            DecimalFormatSymbols dfs_a = (DecimalFormatSymbols) a;
            DecimalFormatSymbols dfs_b = (DecimalFormatSymbols) b;
            String strings_a[] = getStringSymbols(dfs_a);
            String strings_b[] = getStringSymbols(dfs_b);
            char chars_a[] = getCharSymbols(dfs_a);
            char chars_b[] = getCharSymbols(dfs_b);
View Full Code Here

        DecimalFormat result = (DecimalFormat)NumberFormat.getCurrencyInstance(displayLocale);
        HackCurrencyInfo hack = (HackCurrencyInfo)(hackData.get(currency.getCurrencyCode()));
        result.setMinimumFractionDigits(hack.decimals);
        result.setMaximumFractionDigits(hack.decimals);
        result.setRoundingIncrement(hack.rounding);
        DecimalFormatSymbols symbols = result.getDecimalFormatSymbols();
        symbols.setCurrencySymbol(hack.symbol);
        result.setDecimalFormatSymbols(symbols);
        return result;
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormatSymbols.setMinusSign(char)'
     */
    public void testSetMinusSign() {
        DecimalFormatSymbols dfs = new DecimalFormatSymbols(ULocale.US);
        char value = dfs.getMinusSign();
        char value1 = (char)(value + 1);
        dfs.setMinusSign(value1);
        char result = dfs.getMinusSign();
        assertNotEqual(value, result);
        assertEquals(value1, result);
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormatSymbols.getCurrencySymbol()'
     */
    public void testGetCurrencySymbol() {
        DecimalFormatSymbols dfs = new DecimalFormatSymbols(ULocale.US);
        assertEquals("$", dfs.getCurrencySymbol());
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.text.DecimalFormatSymbols.setCurrencySymbol(String)'
     */
    public void testSetCurrencySymbol() {
        DecimalFormatSymbols dfs = new DecimalFormatSymbols(ULocale.US);
        String value = dfs.getCurrencySymbol();
        String value1 = value + "!";
        dfs.setCurrencySymbol(value1);
        String result = dfs.getCurrencySymbol();
        assertNotEqual(value, result);
        assertEquals(value1, result);
    }
View Full Code Here

TOP

Related Classes of com.ibm.icu.text.DecimalFormatSymbols

Copyright © 2018 www.massapicom. 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.