Since it is not possible with standard Java formatter, I can offer a custom formatter
public static void main(String[] args) throws Exception { System.out.println(formatLakh(123456.00)); } private static String formatLakh(double d) { String s = String.format(Locale.UK, "%1.2f", Math.abs(d)); s = s.replaceAll("(.+)(...\\...)", "$1,$2"); while (s.matches("\\d{3,},.+")) { s = s.replaceAll("(\\d+)(\\d{2},.+)", "$1,$2"); } return d < 0 ? ("-" + s) : s; }
Exit
1,23,456.00
Evgeniy Dorofeev
source share