PHP

PHP floor()

Rounding Numbers Down with the PHP floor() Function, with Examples

This short tutorial will cover how to use the PHP floor() function to round numbers DOWN – and provide some code examples. The PHP floor() function rounds a number down (and only down!) to the nearest integer. To round a number up to the nearest integer, use the ceil() function instead. To round a number… Read More »Rounding Numbers Down with the PHP floor() Function, with Examples

PHP ceil()

Rounding Numbers Up with the PHP ceil() Function, with Examples

This short tutorial will cover how to use the PHP ceil() function to round numbers UP – and provide some code examples. The PHP ceil() function rounds a number up (and only up!) to the nearest integer. To round a number down to the nearest integer, use the floor() function instead. To round a number… Read More »Rounding Numbers Up with the PHP ceil() Function, with Examples