Einzelnen Beitrag anzeigen
Alt 10.03.2002, 12:43   #7
RaistlinMajere
Inventar
 
Registriert seit: 06.04.2001
Alter: 44
Beiträge: 2.343


Standard

Code:
import java.text.*;

public class runden {

    double zahl = 1234.56789;   
    DecimalFormat df;
    
    public runden() {
        df = new DecimalFormat("#0.00");
        System.out.println(zahl);
        System.out.println(df.format(zahl));
        System.out.println(df.parse(zahl).doubleValue());
    }
    
    public static void main(String[] nix) {
        new runden();
    }
}

runden.java [12:1] cannot resolve symbol
symbol : method parse (double)
location: class java.text.DecimalFormat
System.out.println(df.parse(zahl).doubleValue());
^
1 error
Errors compiling runden().
____________________________________
"Life is like a box of rockets," said the Marine. "You never know what you´re gonna ret."
Then he pulled the trigger of his BFG9000.
RaistlinMajere ist offline   Mit Zitat antworten