How to round a higher integer in division with php

Hi,

Fiber Optic Transmitter output can be divided into 4
How many fiber optic transmitters are needed by dividing the number of optical points by 4?
15/4 = 3,75, It should be 4 as there will not be 3.75 devices

Completing the next number in the division process if it exceeds the whole number
Sample:
15/4 = 3,75 = round up one number: 4
xx/x = 5,00 = round up one number: 5
xx/x = 5,01 = round up one number: 6
xx/x = 5,99 = round up one number: 6
xx/x = 22,00 = round up one number: 22
xx/x = 22,01 = round up one number: 23
round to the next integer if there is a number after the comma

How do I do this with php?

https://www.php.net/manual/en/function.ceil.php

1 Like

Thank you
I used ceil, it did my job

Sponsor our Newsletter | Privacy Policy | Terms of Service