Classe ‘MessageFormat’: Exemple de Format pourcentage

Author:


{filelink=5929}


import java.text.MessageFormat;

public class FormatPoucentage {
  public static void main(String[] argv) throws Exception {

    Object[] data = new Object[] { new Double(123.45), new Double(123.56) };
    String msg = MessageFormat.format("de {0,number,percent} � {1,number,percent}", data);

    System.out.println(msg);

  }
}

A Voir sur le même Sujet:

  • java formatter pourcentage
  • expression regulière pourcentage java

Leave a Reply

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