1. Home
  2. Computing & Technology
  3. PHP / MySQL
Angela Bradley
Angela's PHP / MySQL Blog

By Angela Bradley, About.com Guide to PHP / MySQL

Floor () - Always Rounding Down

Friday October 2, 2009

The Floor() PHP function is used to always round down to the nearest whole number. The PHP function Floor () behaves identical to the MySQL use; even the largest decimal will always be rounded down.

Comments
October 26, 2009 at 1:43 am
(1) Salman says:

You’ve probably mixed up ceil() function examples with floor(). If this is not the case then here are few corrections :

echo ceil(3.99999999);
// should echo 4, NOT 3

echo ceil(-3.14159265);
// should echo -3, not -4

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.