import java.util.Formatter;
public class FormatageSortie {
public static void main(String[] argv) throws Exception {
Formatter fmt = new Formatter();
fmt.format("Aucune précision sur le décimal: %fn", 10.0 / 3.0);
fmt.format("deux chiffres après la virgule: %.2f", 10.0 / 3.0);
System.out.println(fmt);
}
}
/**
* Sortie
* Aucune précision sur le décimal: 3,333333
* deux chiffres après la virgule: 3,33
*
*/