Java tutorial
//package com.java2s; import java.text.DecimalFormat; import java.util.Locale; public class Main { public static String numberFormat(Double number) { DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance(Locale.getDefault()); return format.format(number); } }