I have a loop which loops items by 24 per time. So it loops 24 items per page. In a page where there are 52 items it does not show the number 3 when I divide 24 by 52.
Example
$TotalProductsString=52;
$theLimitOfItems=12;
$TotalPageSum=$TotalProductsString/$theLimitOfItems;
echo round($TotalPageSum, 2); // display 2.17
echo round($TotalPageSum, 2); // display 2.2
echo round($TotalPageSum, 0.60); // display 2
echo round($TotalPageSum, 0.50); // display 2
It should display 3 as there is a remainder 52/24 = 2.16 with remainder 4 (24+24=48 + 4 = 52)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.