Formatting Output

Why when I type this code report += "Total Value: $%.2f" + (value) + "\n";does it not give 2 digits? and instead returns thisTotal Value: 11.059999999999999Thanks!
[198 byte] By [Back2Schoola] at [2007-11-26 23:48:15]
# 1

public class FormatExample {

public static void main(String[] args) {

String s = String.format("Total Value: $%.2f%n", Math.PI);

System.out.println(s);

}

}

DrLaszloJamfa at 2007-7-11 15:23:40 > top of Java-index,Java Essentials,New To Java...
# 2
System.out.printf("Total Value: $%.2f%n", Math.PI);
floundera at 2007-7-11 15:23:40 > top of Java-index,Java Essentials,New To Java...
# 3
> System.out.printf("Total Value: $%.2f%n", Math.PI);We prefer System.out.format("Total Value: $%.2f%n", Math.PI),but used String.format because in the original code, the OP didn'tprint the string to System.out
DrLaszloJamfa at 2007-7-11 15:23:40 > top of Java-index,Java Essentials,New To Java...