here's a piece of Java code:
import java.util.*;
public class javaTests
{
public static void main(String[] args)
{
double decimal = 0.60;
System.out.println(decimal);
}
}
I'm trying to print 0.60, but the compiler prints 0.6. How can I get this to print 0.60? Thanks!
NumberFormat formatter = new DecimalFormat("#0.00");
double decimal = 0.60;
System.out.println(formatter.format(decimal));