title: Parsing string to double - java
body: <p>For a project I have a program that is like a bank. The "bank" reads in a file with accounts in it that look like this: <br>
  Miller<br>
  William<br>
  00001<br>
  891692 06    &lt;----string that needs to be converted to double <br>
  The last string has to be converted to a double so that the program can perform calculations on it like addition and subtraction, etc. <br>
  And also I have to print it out in monetary format, i.e. $891692.06</p>
  
  <p>I have this so far: <br></p>
  
  <pre><code> public class Account {
        private String firstName, lastName;
        private int accountID;
        private String currentBalance; 
  
        private static int maxAccountID;
  
        public Account(String fN, String lN, int acct, String bal) {
           firstName = fN; lastName = lN;
           accountID = acct;
           currentBalance = bal;
           if(accountID &gt; Account.maxAccountID)
              Account.maxAccountID = accountID;
        }     
  
    public double getBalance(){
          String [] s = currentBalance.split(" ");
          String balStr = "$"+s[0]+"."+s[1];
              double currentBalance = Double.parseDouble(balStr);
           return currentBalance;
        }
  }
  </code></pre>
  
  <p>Thanks in advance!</p>