0
我分2个数字,并希望在适当时返回小数。但它在所有方面都回归整数。Float不会返回小数时分
float temp = (twoMileInSeconds - 774)/6;
timeIndex = (int)Math.floor(temp);
debug1.setText("Before rounding: " + temp);
debug2.setText("After rounding: " + timeindex);
感谢
twoMileInSeconds是一个int。它应该是浮动的吗? – th3ramr0d
是啊改变twoMileInSeconds浮动,现在它显示正确的小数。谢谢! – th3ramr0d
我可以得到一个ramrod大拇指吗? –