Java DecimalFormat format decimal to String and add unicode currency sign

Description

Java DecimalFormat format decimal to String and add unicode currency sign

import java.text.DecimalFormat;

public class Main {
  public static void main(String[] args) throws Exception {
    DecimalFormat myFormatter = new DecimalFormat("\u00a5###,###.###");
    String output = myFormatter.format(123456.78999999);
    System.out.println(output);/*from   ww  w.  j  a va2 s.c  om*/
  }
}



PreviousNext

Related