s3a
October 18th, 2009, 04:43 AM
In the following code:
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();
DecimalFormat formatter = new DecimalFormat("#0000.000");
System.out.println(formatter.format(number));
}
}
What does the # do in the line in bold?
Any input would be greatly appreciated!
Thanks in advance!
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();
DecimalFormat formatter = new DecimalFormat("#0000.000");
System.out.println(formatter.format(number));
}
}
What does the # do in the line in bold?
Any input would be greatly appreciated!
Thanks in advance!