标签:
import java.text.DecimalFormat;
public class FileTest {
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("#,##0.00");
System.out.println(df.format(12345.626));
System.out.println(df.format(12345.6));
}
}
结果为:
12,345.63
12,345.60
标签:
原文地址:http://www.cnblogs.com/AZZCS-0222/p/4894469.html