s3a
October 17th, 2009, 10:33 PM
Here is my code:
//import javax.swing.JOptionPane;
import java.text.DecimalFormat;
import java.util.Scanner;
public class decform_checker
{
public static void main (String [] args)
{
Scanner kb = new Scanner(System.in);
double number = kb.nextDouble;
//double number = 268.324825;
DecimalFormat formatter = new DecimalFormat("#0000.000");
System.out.println(formatter.format(number));
}
}
If I were to uncomment that line that is bold, and comment the other line that is bold, my program would work but at the moment it does not! Could someone please tell me what I am doing wrong? (the compilation error says that it doesn't see a symbol on the line I have bold that is not commented)
Thanks in advance!
//import javax.swing.JOptionPane;
import java.text.DecimalFormat;
import java.util.Scanner;
public class decform_checker
{
public static void main (String [] args)
{
Scanner kb = new Scanner(System.in);
double number = kb.nextDouble;
//double number = 268.324825;
DecimalFormat formatter = new DecimalFormat("#0000.000");
System.out.println(formatter.format(number));
}
}
If I were to uncomment that line that is bold, and comment the other line that is bold, my program would work but at the moment it does not! Could someone please tell me what I am doing wrong? (the compilation error says that it doesn't see a symbol on the line I have bold that is not commented)
Thanks in advance!