Examples of DecimalFormatSymbols


Examples of java.text.DecimalFormatSymbols

   * string is null, zero length, or otherwise
   * malformed.
   */
  public PrintfFormat(Locale locale,String fmtArg)
  throws IllegalArgumentException {
    dfs = new DecimalFormatSymbols(locale);
    int ePos=0;
    ConversionSpecification sFmt=null;
    String unCS = this.nonControl(fmtArg,0);
    if (unCS!=null) {
      sFmt = new ConversionSpecification();
View Full Code Here

Examples of java.text.DecimalFormatSymbols

      throw new IllegalFormatConversionException(c, arg.getClass());
  }

  private char getZero(Locale l) {
      if ((l != null) &&  !l.equals(locale())) {
    DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
    return dfs.getZeroDigit();
      }
      return zero;
  }
View Full Code Here

Examples of java.text.DecimalFormatSymbols

      if (dot < len) {
    if (l == null || l.equals(Locale.US)) {
        decSep  = '.';
    } else {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        decSep  = dfs.getDecimalSeparator();
    }
      }

      if (f.contains(Flags.GROUP)) {
    if (l == null || l.equals(Locale.US)) {
        grpSep = ',';
        grpSize = 3;
    } else {
        DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
        grpSep = dfs.getGroupingSeparator();
        DecimalFormat df = (DecimalFormat) NumberFormat.getIntegerInstance(l);
        grpSize = df.getGroupingSize();
    }
      }
View Full Code Here

Examples of java.text.DecimalFormatSymbols

  init(new BufferedWriter(new OutputStreamWriter(os, csn)), l);
    }

    private void setZero() {
  if ((l != null) && !l.equals(Locale.US)) {
      DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(l);
      zero = dfs.getZeroDigit();
  }
    }
View Full Code Here

Examples of java.text.DecimalFormatSymbols

   *
   * @param defaultMaxDigits default max digits
   */
  public AbstractGraphicsDocument(int defaultMaxDigits) {
    Locale locale = new Locale("en", "US");
    DecimalFormatSymbols decimalSymbols = new DecimalFormatSymbols(locale);
    decimalSymbols.setDecimalSeparator('.');
    formatter = new DecimalFormat();
    formatter.setDecimalFormatSymbols(decimalSymbols);

    // do not group
    formatter.setGroupingSize(0);
View Full Code Here

Examples of java.text.DecimalFormatSymbols

    DecimalFormat decimalFormat = new DecimalFormat(); // create new as this is not thread safe
    decimalFormat.setDecimalSeparatorAlwaysShown(false);
    decimalFormat.setGroupingUsed(false);
    decimalFormat.setMinimumFractionDigits(0);
    decimalFormat.setMaximumFractionDigits(100);
    DecimalFormatSymbols symbols = new DecimalFormatSymbols();
    symbols.setDecimalSeparator('.');
    decimalFormat.setDecimalFormatSymbols(symbols);

    url.append("&bbox=");
    url.append(decimalFormat.format(box.getX()));
    url.append(",");
View Full Code Here

Examples of java.text.DecimalFormatSymbols

    if (numberFormat instanceof DecimalFormat) {
      symbols = ( (DecimalFormat) numberFormat).getDecimalFormatSymbols();
    }
    else {
      symbols = new DecimalFormatSymbols();
    }
  }
View Full Code Here

Examples of java.text.DecimalFormatSymbols

      return "";

    String format = MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_DoubleFormat", null, facesContext.getViewRoot().getLocale());   
    DecimalFormat  numberFormat = new DecimalFormat(format);   
   
    DecimalFormatSymbols dfs = new DecimalFormatSymbols();

    dfs.setDecimalSeparator(MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_DecimalSeparator", null, facesContext.getViewRoot().getLocale()).charAt(0));
    dfs.setGroupingSeparator(MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_GroupingSeparator", null, facesContext.getViewRoot().getLocale()).charAt(0));

    numberFormat.setDecimalFormatSymbols(dfs);
       
    return numberFormat.format(obj);
  }
View Full Code Here

Examples of java.text.DecimalFormatSymbols

    try
    {
      String format = MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_DoubleFormat", null, facesContext.getViewRoot().getLocale());   
      DecimalFormat  numberFormat = new DecimalFormat(format);   

      DecimalFormatSymbols dfs = new DecimalFormatSymbols();

      dfs.setDecimalSeparator(MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_DecimalSeparator", null, facesContext.getViewRoot().getLocale()).charAt(0));
      dfs.setGroupingSeparator(MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_GroupingSeparator", null, facesContext.getViewRoot().getLocale()).charAt(0));

      numberFormat.setDecimalFormatSymbols(dfs);
     
      return new Double(numberFormat.parse(str).doubleValue());
    }
View Full Code Here

Examples of java.text.DecimalFormatSymbols

    }

    String format = MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_IntegerFormat", null, facesContext.getViewRoot().getLocale());   
    DecimalFormat  numberFormat = new DecimalFormat(format);   
   
    DecimalFormatSymbols dfs = new DecimalFormatSymbols();

    dfs.setDecimalSeparator(MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_DecimalSeparator", null, facesContext.getViewRoot().getLocale()).charAt(0));
    dfs.setGroupingSeparator(MessagesLoader.getMessageResourceString(facesContext.getApplication().getMessageBundle(), "Application_GroupingSeparator", null, facesContext.getViewRoot().getLocale()).charAt(0));

    numberFormat.setDecimalFormatSymbols(dfs);
   
    return numberFormat.format(obj);
  }
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.