note 38315 added to function.round
| From: | osandova at ing dot puc dot cl | Date: | Tue, 16 Dec 2003 16:35:25 +0000 |
| Subject: | note 38315 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62075@lists.php.net to get a copy of this message | ||
This is a function to truncate a numer. Could be usefull.
Trunc($num,$num_dec)
{
preg_match("/^(\d*)(\.)(\d{" . ($num_dec + 0) . "})/",$num, $matches);
return $matches[1] . $matches[2] . $matches[3];
}
Hasta luego.
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38315
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38315&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38315&report=yes
Search -- http://master.php.net/manage/user-notes.php