title: Decimal Format in Jframe?
body: <p>I am making a pizza calculator but my results come out as "$7.5" instead of "$7.50". I have this decimal format code written out with my code below it, but it doesn't seem to work. Any ideas?</p>
  
  <pre><code>    private void calculateButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                
  
      double diameter;
      double labourCost = 1.00;
  
      diameter = Double.parseDouble(diameterInput.getText());
  
      double storeCost = 1.50;
      double materialsCost = 0.50 * diameter;
      double totalCost = labourCost + storeCost + materialsCost;
  
      DecimalFormat x = newDecimalFormat("0.00"); 
  
      costOutput.setText("The cost of the pizza is $" + totalCost);
  </code></pre>