去掉double类型后边的 .00

1. 去掉double类型后边的 .00

在开发过程中,对于double类型的数据,比如 800.00,去掉后边的 .00做法:

double aa = 800.00;
// 去掉double后边的 .00
String newD = String.valueOf(aa).substring(0,String.valueOf(aa).indexOf("."));
Log.e("TAG" , "newD:"+newD);

你可能感兴趣的:(去掉double类型后边的 .00)