title: formating Double values in I/O files in java...
body: <p>Please how do i format the value of the updatedsalary in this program to 2 decimal places???</p>
  
  <pre><code>     package elapsedTime;
  import java.io.*;
  import java.util.*;
  public class Salary {
  
  public static void main(String[] args)throws FileNotFoundException {
      String firstname,lastname;
      double currentSalary, PayIncrease;
      double updatedsalary;
  Scanner infile=new Scanner(new FileReader("Ch3_Ex7Data.txt"));
  PrintWriter Outfile=new PrintWriter("Outdata.dat");
      firstname=infile.next();
      lastname=infile.next();
      currentSalary=infile.nextDouble();
      PayIncrease=infile.nextDouble();
      updatedsalary=((PayIncrease*currentSalary)/100)+currentSalary;
  Outfile.printf("FIRSTNAME:"+firstname+"\n"+"LASTNAME:"+lastname+"\n"+"UPDATEDSALARY:"+updatedsalary+"\n"+"\n");
  firstname=infile.next();
  lastname=infile.next();
  currentSalary=infile.nextDouble();
  PayIncrease=infile.nextDouble();
  updatedsalary=((PayIncrease*currentSalary)/100)+currentSalary;
  Outfile.printf("FIRSTNAME:"+firstname+"\n"+"LASTNAME:"+lastname+"\n"+"UPDATEDSALARY:"+updatedsalary+"\n"+"\n");
  firstname=infile.next();
  lastname=infile.next();
  currentSalary=infile.nextDouble();
  PayIncrease=infile.nextDouble();
  updatedsalary=((PayIncrease*currentSalary)/100)+currentSalary;
  Outfile.printf("FIRSTNAME:"+firstname+"\n"+"LASTNAME:"+lastname+"\n"+"UPDATEDSALARY:"+updatedsalary+"\n"+"\n");
  infile.close();
  Outfile.close();
  }
  </code></pre>
  
  <p>}
   i am mainly confused as to where to use the format specifiers in the Outfile.printf statement..</p>