Package java.text

Examples of java.text.DecimalFormatSymbols


  {
    NumberFormat nfmt;

    if(_PATTERN_TYPE == formatType)
    {
      DecimalFormatSymbols symbols = _getCachedDecimalFormatSymbol(locale);

      if (null == symbols)
      {
         symbols = new DecimalFormatSymbols(locale);
         // cache this - It is cloned while caching.
        _cacheDecimalFormatSymbols(locale, symbols);
      }
      nfmt = new DecimalFormat(pattern, symbols);
    }
View Full Code Here


    // Potential ClassCastException before the change
    //if (numberFormatter instanceof NumberFormat)
    if (numberFormatter instanceof DecimalFormat)
    {
      DecimalFormat dfmt = (DecimalFormat)numberFormatter;
      DecimalFormatSymbols symbols = dfmt.getDecimalFormatSymbols();
      _setCurrencyInformation(context, symbols);
      dfmt.setDecimalFormatSymbols(symbols);
    }
    else
    //string cat at compile time.
View Full Code Here

        NumberFormat nf = null;
        int style = getNumberStyleAsInt(format);
        if (style < 0)
        {
            // we have a custom format
            nf = new DecimalFormat(format, new DecimalFormatSymbols(locale));
        }
        else
        {
            // we have a standard format
            nf = getNumberFormat(style, locale);
View Full Code Here

        {
            return null;
        }

        // format according to the given pattern
        DecimalFormat df = new DecimalFormat(metaData.pattern(), new DecimalFormatSymbols(Locale.US));
        return df.parse(configuredValue).floatValue();
    }
View Full Code Here

    Locale locale = _getLocale(reqCtx, context);

    NumberFormat fmt = _getNumberFormat(pattern, type, locale, reqCtx);
   
    DecimalFormat df = (DecimalFormat)fmt;
    DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();
    if (dfs.getGroupingSeparator() == '\u00a0')
      value = value.replace(' ', '\u00a0');
        

    ParsePosition pp = new ParsePosition(0);
    Number num = (Number) fmt.parseObject(value,pp);
View Full Code Here

    if (nfmt instanceof DecimalFormat)
    {
      DecimalFormat dfmt = (DecimalFormat)nfmt;

      // what we get here is a shallow copy. cloned DFS
      DecimalFormatSymbols dfSymbols = dfmt.getDecimalFormatSymbols();

      _setUpDecimalSymbolFormatProperties(dfSymbols, reqCtx, locale);

      //since we get a shallow copy - setting it again after modification.
      ((DecimalFormat) nfmt).setDecimalFormatSymbols(dfSymbols);
View Full Code Here

  {
    NumberFormat nfmt;

    if(_PATTERN_TYPE == formatType)
    {
      DecimalFormatSymbols symbols = _getCachedDecimalFormatSymbol(locale);

      if (null == symbols)
      {
         symbols = new DecimalFormatSymbols(locale);
         // cache this - It is cloned while caching.
        _cacheDecimalFormatSymbols(locale, symbols);
      }
      nfmt = new DecimalFormat(pattern, symbols);
    }
View Full Code Here

    // Potential ClassCastException before the change
    //if (numberFormatter instanceof NumberFormat)
    if (numberFormatter instanceof DecimalFormat)
    {
      DecimalFormat dfmt = (DecimalFormat)numberFormatter;
      DecimalFormatSymbols symbols = dfmt.getDecimalFormatSymbols();
      _setCurrencyInformation(context, symbols);
      dfmt.setDecimalFormatSymbols(symbols);
    }
    else
    //string cat at compile time.
View Full Code Here

                    {
                        df.setParseBigDecimal(true);
                    }
                }
               
                DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();
                boolean changed = false;
                if(dfs.getGroupingSeparator() == '\u00a0')
                {
                  dfs.setGroupingSeparator(' ');
                  df.setDecimalFormatSymbols(dfs);
                  changed = true;
                }
               
                formatCurrency(format);
               
                try
                {
                    return format.parse(value);
                }
                catch (ParseException e)
                {
                  if(changed)
                  {
                    dfs.setGroupingSeparator('\u00a0');
                    df.setDecimalFormatSymbols(dfs);
                  }
                  try
                  {
                    return format.parse(value);
View Full Code Here

        }

        // pattern
        if (_pattern != null)
        {
            return new DecimalFormat(_pattern, new DecimalFormatSymbols(locale));
        }

        // type
        if (_type.equals("number"))
        {
View Full Code Here

TOP

Related Classes of java.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.