Cannot output formatted double in Java
        Posted  
        
            by via-point
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by via-point
        
        
        
        Published on 2010-03-31T02:35:49Z
        Indexed on 
            2010/03/31
            2:43 UTC
        
        
        Read the original article
        Hit count: 241
        
java
Here's what I do:
double x = 7.0;  
System.out.printf("%.2f", x);
Eclipse gives me this error "The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, double)"
© Stack Overflow or respective owner