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

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -