欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

java 给数值添加千分位。

程序员文章站 2022-06-30 08:54:13
1 private static String nuber(double n) { 2 // TODO Auto-generated method stub 3 String str=DecimalFormat.getNumberInstance().format(n);//该方法精度只保留小数点后... ......
1 private static string nuber(double n) {
2         // todo auto-generated method stub
3         string str=decimalformat.getnumberinstance().format(n);//该方法精度只保留小数点后三位
4         return str;
5 }