double d=4.22;
小数转为整数分为:
1.直接去除小数:Integer.parseInt(d);
2.4舍5入到整数:Math.round(d);
3.取小数的最小整数(向下取整):Math.floor(d);
4.取小数的最大整数(向上取整):Math.ceil(d);
double d=4.22;
小数转为整数分为:
1.直接去除小数:Integer.parseInt(d);
2.4舍5入到整数:Math.round(d);
3.取小数的最小整数(向下取整):Math.floor(d);
4.取小数的最大整数(向上取整):Math.ceil(d);