Package org.pentaho.reporting.libraries.formatting

Examples of org.pentaho.reporting.libraries.formatting.FastDecimalFormat


    else
    {
      final ExpressionRuntime runtime = getRuntime();
      final Locale locale = runtime.getResourceBundleFactory().getLocale();

      final FastDecimalFormat fastPercent = new FastDecimalFormat(FastDecimalFormat.TYPE_PERCENT, locale);
      final FastDecimalFormat fastInteger = new FastDecimalFormat(FastDecimalFormat.TYPE_INTEGER, locale);

      final DecimalFormat numFormat = new DecimalFormat(fastInteger.getPattern(), new DecimalFormatSymbols(locale));
      numFormat.setRoundingMode(RoundingMode.HALF_UP);

      final DecimalFormat percentFormat = new DecimalFormat(fastPercent.getPattern(), new DecimalFormatSymbols(locale));
      percentFormat.setRoundingMode(RoundingMode.HALF_UP);
View Full Code Here


        if (getLinePeriodCount() > 0)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final FastDecimalFormat formatter = new FastDecimalFormat
                (getLineTicksLabelFormat(), getResourceBundleFactory().getLocale());
            numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount(), formatter));
          }
          else
          {
View Full Code Here

    else
    {
      final ExpressionRuntime runtime = getRuntime();
      final Locale locale = runtime.getResourceBundleFactory().getLocale();

      final FastDecimalFormat fastPercent = new FastDecimalFormat(FastDecimalFormat.TYPE_PERCENT, locale);
      final FastDecimalFormat fastInteger = new FastDecimalFormat(FastDecimalFormat.TYPE_INTEGER, locale);

      final DecimalFormat numFormat = new DecimalFormat(fastInteger.getPattern(), new DecimalFormatSymbols(locale));
      numFormat.setRoundingMode(RoundingMode.HALF_UP);

      final DecimalFormat percentFormat = new DecimalFormat(fastPercent.getPattern(), new DecimalFormatSymbols(locale));
      percentFormat.setRoundingMode(RoundingMode.HALF_UP);
View Full Code Here

    if (coordinates == null || coordinates.length == 0)
    {
      return null;
    }

    final FastDecimalFormat decimalFormat =
        new FastDecimalFormat("######################0.0########", Locale.US);
    final StringBuffer b = new StringBuffer(coordinates.length * 10);
    b.append(decimalFormat.format(coordinates[0] * scale));
    for (int i = 1; i < coordinates.length; i++)
    {
      final float coordinate = coordinates[i];
      b.append(',');
      b.append(decimalFormat.format(coordinate * scale));
    }
    return b.toString();
  }
View Full Code Here

        {
          numberAxis.setTickUnit(new NumberTickUnit(getRangePeriodCount(), getRangeTickFormat()));
        }
        else if (getRangeTickFormatString() != null)
        {
          final FastDecimalFormat formatter = new FastDecimalFormat
              (getRangeTickFormatString(), getResourceBundleFactory().getLocale());
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount(), formatter));
        }
        else
        {
View Full Code Here

        if (getLinePeriodCount() > 0)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final FastDecimalFormat formatter = new FastDecimalFormat
                (getLineTicksLabelFormat(), getResourceBundleFactory().getLocale());
            numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount(), formatter));
          }
          else
          {
View Full Code Here

    }
  }

  public String toString()
  {
    final FastDecimalFormat numberInstance = new FastDecimalFormat("#0.####", Locale.US);
    return numberInstance.format(new BigDecimal(value)) + unit.getName();
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.formatting.FastDecimalFormat

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.