Classe ‘MessageFormat’: Utilisation d’un formatage personnalisé

Author:


{filelink=5926}


import java.text.MessageFormat;

public class FormatagePersonnel {
  public static void main(String[] argv) throws Exception {
    Object[] params = new Object[] { new Integer(128), new Integer(255) };
    String msg = MessageFormat.format("{0,number,#} a''s and {1,number,#} b''s", params);
    System.out.println(msg);
  }
}
/*
 * Affichage:
 * 123 a's and 1234 b's
 *
 **/

A Voir sur le même Sujet:

  • creer un maskformatter en java
  • maskformatter heure
  • swing MaskFormatter taille variable
  • Date MaskFormatter
  • maskformatter java example
  • messageformat exemple
  • messageformat nombres

Leave a Reply

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