Package java.text

Examples of java.text.NumberFormat.format()


      pieData.setValue(stageName + " (" + count.toString() + ")", forecastAmount);
    }

    // format the totals as US Currency
    NumberFormat numFormatter = NumberFormat.getCurrencyInstance();
    String totalForecastString = numFormatter.format(totalForecast);
    String totalActualString = numFormatter.format(totalActual);

    // create the chart
    JFreeChart pieChart = ChartFactory.createPieChart("Opportunities by Stage", pieData, true, true, false);
View Full Code Here


    }

    // format the totals as US Currency
    NumberFormat numFormatter = NumberFormat.getCurrencyInstance();
    String totalForecastString = numFormatter.format(totalForecast);
    String totalActualString = numFormatter.format(totalActual);

    // create the chart
    JFreeChart pieChart = ChartFactory.createPieChart("Opportunities by Stage", pieData, true, true, false);

    // set the sub-title
View Full Code Here

      chartData.setValue(forecastAmount, stageName, month);
    }

    NumberFormat numFormatter = NumberFormat.getCurrencyInstance();
    String totalForecastString = numFormatter.format(totalForecast);
    String totalActualString = numFormatter.format(totalActual);

    // create the chart
    JFreeChart barChart = ChartFactory.createStackedBarChart("Opportunities by Month", "Month", "Opportunity Value ($)",
                                                             chartData, org.jfree.chart.plot.PlotOrientation.VERTICAL,
View Full Code Here

      chartData.setValue(forecastAmount, stageName, month);
    }

    NumberFormat numFormatter = NumberFormat.getCurrencyInstance();
    String totalForecastString = numFormatter.format(totalForecast);
    String totalActualString = numFormatter.format(totalActual);

    // create the chart
    JFreeChart barChart = ChartFactory.createStackedBarChart("Opportunities by Month", "Month", "Opportunity Value ($)",
                                                             chartData, org.jfree.chart.plot.PlotOrientation.VERTICAL,
                                                             true, true, false);
View Full Code Here

          if (eta_ms >= 0)
          {
            long eta_min = eta_ms/60000;
            long eta_s = (eta_ms-(eta_min*60000))/1000;
            mTemplate.setValue("eta_min", eta_min);
            mTemplate.setValue("eta_s", format.format(eta_s));
            mTemplate.setBlock("eta", "eta");
          }
          mTemplate.setValue("processedCount", sIndexingThread.getProcessedCount());
          mTemplate.setValue("totalCount", sIndexingThread.getTotalCount());
        }
View Full Code Here

  protected final String formatZoomText(final double zoom)
  {
    final NumberFormat numberFormat =
        NumberFormat.getPercentInstance(swingGuiContext.getLocale());
    return (numberFormat.format(zoom));
  }

  private void buildMenu(final Map actions)
  {
    final Iterator oldActions = this.zoomActions.values().iterator();
View Full Code Here

    final long nodeWidth = rc.getWidth();
    final long nodeHeight = rc.getHeight();
    final NumberFormat pointConverter = styleBuilder.getPointConverter();
    styleBuilder.append("overflow", "hidden"); //NON-NLS
    styleBuilder.append(WIDTH_STYLE, pointConverter.format//NON-NLS
        (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue(nodeWidth), safariLengthFix)), PT_UNIT);
    styleBuilder.append(HEIGHT_STYLE, pointConverter.format//NON-NLS
        (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue(nodeHeight), safariLengthFix)), PT_UNIT);
    return styleBuilder;
  }
View Full Code Here

    final long nodeHeight = rc.getHeight();
    final NumberFormat pointConverter = styleBuilder.getPointConverter();
    styleBuilder.append("overflow", "hidden"); //NON-NLS
    styleBuilder.append(WIDTH_STYLE, pointConverter.format//NON-NLS
        (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue(nodeWidth), safariLengthFix)), PT_UNIT);
    styleBuilder.append(HEIGHT_STYLE, pointConverter.format//NON-NLS
        (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue(nodeHeight), safariLengthFix)), PT_UNIT);
    return styleBuilder;
  }

  /**
 
View Full Code Here

      if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO) &&
          (contentWidth > 0 && contentHeight > 0))
      {
        final double scaleFactor = Math.min(nodeWidth / (double) contentWidth, nodeHeight / (double) contentHeight);

        styleBuilder.append(WIDTH_STYLE, pointConverter.format
            (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue((long) (contentWidth * scaleFactor)),
                safariLengthFix)), PT_UNIT);
        styleBuilder.append(HEIGHT_STYLE, pointConverter.format
            (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue((long) (contentHeight * scaleFactor)),
                safariLengthFix)), PT_UNIT);
View Full Code Here

        final double scaleFactor = Math.min(nodeWidth / (double) contentWidth, nodeHeight / (double) contentHeight);

        styleBuilder.append(WIDTH_STYLE, pointConverter.format
            (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue((long) (contentWidth * scaleFactor)),
                safariLengthFix)), PT_UNIT);
        styleBuilder.append(HEIGHT_STYLE, pointConverter.format
            (HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue((long) (contentHeight * scaleFactor)),
                safariLengthFix)), PT_UNIT);
      }
      else
      {
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.