title: Decimal format for currency
body: <p>I'm having a hard time getting a decimal format with currency added to my String.  I've created a table with columns and rows that calculates through a while, for, and do while loop. I use table as my string to show my results. which displays my results. I'm trying to get it to format to ("$0.00"); for the whole table.</p>
  
  <p>Any suggestions? I'm very new at coding so I apologize if this isn't enough information. </p>
  
  <pre><code>String result = String.format("$0.00");
  System.out.println(table);
  </code></pre>
  
  <p>An example of my Do While Loop.</p>
  
  <pre><code>int col;  
  int row = 0;
  double tempRate = startingRate;       
  double header;                    
  double sideHeader;       
  table = "";
  
  for (header = 0; header &lt; tableSize; header++) {
  
    table += " " + startingRate;
    startingRate += 0.05;
  
  }
  
  startingRate = tempRate;
  
  table += "\n";
  do {
    col = 0;
  
    startingRate = tempRate;
  
    sideHeader = 0;
    table += startingAmount + " ";
    do {
  
      table=table + (startingAmount -(startingRate * startingAmount)) + " ";
      startingRate+= .05;
  
      col++;
  
    } while (col &lt; tableSize);
  
    startingAmount+= 0.50;
  
    row++;
    table+= "\n";
  
  } while (row &lt; tableSize);
  
  sideHeader++;
  </code></pre>