Number Format by locale
import java.text.NumberFormat; import java.util.Locale; class NumberFormatApp { public static void main(String args[]) { NumberFormat format = NumberFormat.getCurrencyInstance(Locale.getDefault()); String formattedCurrency = format.format(1000000); System.out.println(formattedCurrency); } }