<?php
echo round(3.14159265);
// Value would be 3echo round(3.9);
// Value would be 4echo round(3.14159265, 3);
// Value would be 3.142echo round(314159, -100);
// Value would be 314100
?>
By Angela Bradley, About.com
<?php
echo round(3.14159265);
// Value would be 3echo round(3.9);
// Value would be 4echo round(3.14159265, 3);
// Value would be 3.142echo round(314159, -100);
// Value would be 314100
?>
PHP Message BoardsComment on the 'Rounding Numbers' Blog Entry
©2008 About.com, a part of The New York Times Company.
All rights reserved.