1. Computing

Rounding and Formatting Numbers

By , About.com Guide

2 of 4

Ceil () - Always Rounding Up
The Ceil () PHP function is used to always round up to the nearest whole number. The PHP function Ceil () behaves identical to the MySQL use; even the smallest decimal will always be rounded up.
<?php 
 echo ceil(3.14159265); 
 // Value would be 4

echo ceil(3.00000001); // Value would be 4

echo ceil(-3.14159265); // Value would be -3 ?>

Related Video
Basic PHP Syntax
Using PHP With HTML
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. PHP Functions
  5. Ceil PHP Function - PHP Ceil number - Ceil number function

©2013 About.com. All rights reserved.