View Single Post
  #6 (permalink)  
Old 04-16-2008, 02:18 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,159
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: Mathematical functions in PHP

round() returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default).

Example:
PHP Code:
<?php
echo round(3.4);         // 3
echo round(3.5);         // 4
echo round(3.6);         // 4
echo round(3.60);      // 4
echo round(1.955832);  // 1.96
echo round(1241757, -3); // 1242000
echo round(5.0452);    // 5.05
echo round(5.0552);    // 5.06
?>
__________________
With,
J. Jeyaseelan

Everything Possible
Reply With Quote