Examples of DecimalFormat


Examples of java.text.DecimalFormat

     * 14 18 22 -2
    
     */
    protected void parseDataFromStream(String line) {
        StringTokenizer tokenizer = new StringTokenizer(line);
        DecimalFormat dec_format = new DecimalFormat();

        try {

            for (int i = 0; i < 2; i++)
                tokenizer.nextToken();
            /*int site_number = */dec_format.parse(tokenizer.nextToken())
                    .intValue();
            ;

            for (int i = 0; i < 2; i++)
                tokenizer.nextToken();
            float time = dec_format.parse(tokenizer.nextToken()).floatValue();

            float latitude = dec_format.parse(tokenizer.nextToken())
                    .floatValue();
            float longitude = dec_format.parse(tokenizer.nextToken())
                    .floatValue();

            tokenizer.nextToken(); // ignore Field 9

            float current_temp = dec_format.parse(tokenizer.nextToken())
                    .floatValue();

            //          float max_temp =
            //              dec_format.parse( tokenizer.nextToken() ).floatValue();
            //          float min_temp =
View Full Code Here

Examples of java.text.DecimalFormat

        }
        else
        {
          if (getLineTicksLabelFormat() != null)
          {
            final DecimalFormat formatter = new DecimalFormat
                (getLineTicksLabelFormat(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
            numberAxis.setNumberFormatOverride(formatter);
          }
        }
      }
View Full Code Here

Examples of java.text.DecimalFormat

    this.buffer = new StringBuffer(100);

    if ("true".equals(ClassicEngineBoot.getInstance().getGlobalConfig().getConfigProperty
        ("org.pentaho.reporting.engine.classic.core.modules.output.table.html.SafariLengthHack")))
    {
      pointConverter = new DecimalFormat("0", new DecimalFormatSymbols(Locale.US));
      safariLengthFix = true;
    }
    else
    {
      safariLengthFix = false;
      pointConverter = new DecimalFormat("0.####", new DecimalFormatSymbols(Locale.US));
    }
  }
View Full Code Here

Examples of java.text.DecimalFormat

      if (Boolean.TRUE.equals(currency))
      {
        final NumberFormat format = NumberFormat.getCurrencyInstance(context.getLocale());
        if (format instanceof DecimalFormat)
        {
          final DecimalFormat decimalFormat = (DecimalFormat) format;
          return decimalFormat.toPattern();
        }
      }

      final DecimalFormat format = new DecimalFormat();
      if (scale != null && precision != null)
      {
        format.setMaximumFractionDigits(scale.intValue());
        format.setMinimumFractionDigits(scale.intValue());
        format.setMaximumIntegerDigits(precision.intValue() - scale.intValue());
        format.setMinimumIntegerDigits(1);
      }
      return format.toPattern();
    }
    return null;
  }
View Full Code Here

Examples of java.text.DecimalFormat

   */
  public String getFormatString()
  {
    if (getFormat() instanceof DecimalFormat)
    {
      final DecimalFormat decFormat = (DecimalFormat) getFormat();
      return decFormat.toPattern();
    }
    return null;
  }
View Full Code Here

Examples of java.text.DecimalFormat

    else
    {
      if (formatString.length() == 0)
      {
        // this is a workaround for a bug in JDK 1.5
        setFormat(new DecimalFormat(NumberFieldElementFactory.DECIMALFORMAT_DEFAULT_PATTERN));
      }
      else
      {
        setFormat(new DecimalFormat(formatString));
      }
    }
  }
View Full Code Here

Examples of java.text.DecimalFormat

        formulaExpression.setFormula(getFormula());
        element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
      }
      if (format != null)
      {
        final DecimalFormat decimalFormat = (DecimalFormat) format;
        final String formatString = decimalFormat.toPattern();
        element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FORMAT_STRING, formatString);
      }
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    }
    else
View Full Code Here

Examples of java.text.DecimalFormat

  /**
   * DefaultConstructor, this object is initialized using a DecimalFormat with the default pattern for this locale.
   */
  public DecimalFormatParser()
  {
    setFormatter(new DecimalFormat());
  }
View Full Code Here

Examples of java.text.DecimalFormat

  /**
   * DefaultConstructor, this object is initialized using a DecimalFormat with the default pattern for this locale.
   */
  public DecimalFormatFilter()
  {
    setFormatter(new DecimalFormat());
  }
View Full Code Here

Examples of java.text.DecimalFormat

   * @throws NullPointerException if the given format is null
   * @throws ClassCastException   if the format is no decimal format
   */
  public void setFormatter(final Format format)
  {
    final DecimalFormat dfmt = (DecimalFormat) format;
    super.setFormatter(dfmt);
  }
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.