我对java有问题,然后我想划分大长类型数字,例如,如果我划分165600139 / 86400000 = 1.9,但我的方法返回1而不四舍五入:/
public static long calcDaysBefore(Date date) {
int MILISECONDS_IN_DAY = 24 * 60 * 60 * 1000;
long days = 0;
if (date != null) {
long current = getCurrentDate().getTime() - date.getTime();
days = current / MILISECONDS_IN_DAY;
}
return days;
}