如何判断一个Double类型的数小数点后有几位

double d =3.9999;
int a=(d+"").length()-(d+"").indexOf(".")-1;

猜你喜欢

转载自www.cnblogs.com/henyu/p/9026004.html