title: Format to print to one decimal point for temperature
body: <p>I am very new to Java and I have to write a program that takes from -40 to 120 Fahrenheit and convert it to Celsius and then display them in two columns with increments of 5 and accurate to one decimal place. I have most of the code finished and I have the right output for the Fahrenheit but I can't figure out how to get the Celsius to print accurate to one decimal place. Anything would be helpful!</p>
  
  <pre><code>package 3;
  
  public class prog2 {
  
       public static void main(String[] args) {
           System.out.println("Fahrenheit to Celsius converter from -40F below to 120F");
            for(double temp = -40.0; temp &lt;= 120; temp += 5) 
            {
               System.out.printf("%10.1f", temp);
               double sum = (temp -32) * (5.0/9.0);  
               System.out.printf("%5d",(int) sum );
               System.out.println();          
        }
     }
  
  }
  </code></pre>