Exemple de justification des caractères à gauche et à droite

Author:


{filelink=4423}


import java.util.Formatter;

public class Justification {
  public static void main(String args[]) {
    Formatter fmt = new Formatter();

    // Justifier à droit
    fmt.format("|%10.2f|", 250.2352);
    System.out.println(fmt);

    // Justification à gauche
    fmt = new Formatter();
    fmt.format("|%-10.2f|", 250.2352);
    System.out.println(fmt);
  }
}

/*

|    250,24|
|250,24    |

*/

A Voir sur le même Sujet:

  • out.write en java de droite à gauche
  • string gauche java
  • recuperer ligne fichier .txt javamail
  • décalage droite perl chaine
  • format java gauche
  • orientation de texte de droite à gauche(ex: arabe )+c#
  • exemple entree sortie graphique java
  • affichage justification nombre java
  • java.mesexemples.com+exemple-de-justification-des-caracteres-a-gauche-et-a-droite
  • justification gauche en java

Leave a Reply

Your email address will not be published. Required fields are marked *