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

double d =3.9999;
int a=(d+"").length()-(d+"").indexOf(".")-1;
posted @ 2018-05-11 18:00  henyu  阅读(12113)  评论(0编辑  收藏  举报