title: java.lang.NumberFormatException: For input string: "20,475.00"
body: <p>i am trying to get the running balance of my system. To do it, i get the sum of all numbers in the jtable from column AMOUNT and subtract the sum to the value inside the txtLoanAmount.
   here's my code snippet:</p>
  
  <pre><code>String LoanAmount = txtLoanAmount.getText();
  float f = Float.valueOf(LoanAmount.trim()).floatValue();
  float balance = 0; 
  float sum = 0;
  
  for(int i=0;i&lt;=tableLedger.getRowCount()-1;i++) {
      sum = sum + Float.parseFloat(tableLedger.getModel().getValueAt(i, 2).toString());
  }
  balance = f - sum;
  System.out.println(balance);
  </code></pre>
  
  <p>now i get the error message :</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "20,475.00"
  </code></pre>
  
  <p>How can i solve this ? any help will be appreciated. Thanks</p>