[JavaScript] 两个数相除有余数时结果加1

实现代码
var total=15;

var item=4;

var page=total%item==0?(total/item):(Math.floor(total/item)+1);

console.log(page)


猜你喜欢

转载自www.cnblogs.com/hspl/p/11899395.html
今日推荐