Round down a decimal number to the nearest integer
In my past post, I talked about rounding up a decimal number to the nearest integer. This time I will show you how to round “down” a decimal number to the nearest integer. This time we use a function floor( ). It is very easy to use, all you have to do is to put the decimal number inside the brackets and it will convert for you. Here are some examples:
<?php echo floor(8.8); ?>
we get: 8
<?php echo floor(-12.66); ?>
we get: -13
<?php echo floor(900.45563); ?>
we get: 900

