ProAnswers.org

How to add grouping specifiers for large value numbers?

The comma (,) flag adds grouping specifiers.

import java.util.Formatter;

public class Main {

  public static void main(String args[]) {

    Formatter fmt = new Formatter();

    fmt.format("%,.2f", 1234567890.34); 

    System.out.println(fmt);

  }

}