eclipse - displaying Java double value -
here's 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 print 0.60, compiler prints 0.6. how can print 0.60? thanks!
numberformat formatter = new decimalformat("#0.00"); double decimal = 0.60; system.out.println(formatter.format(decimal));      
Comments
Post a Comment