RE: [PHP] Stupid question
| From: | Craig Vincent | Date: | Thu, 02 May 2002 09:54:11 +0000 |
| Subject: | RE: [PHP] Stupid question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95664@lists.php.net to get a copy of this message | ||
> I have a script that outputs this:
> 0.023884057998657
>
> What's the command to make it shrink down to this:
> 0.023
>
>
> I thought it was eregi() something, but I forgot. sorry
It depends on what you need.
If you want to round the number off to 3 decimal points use the round()
function. However if you don't want to round and instead just want to
truncate the number, the number_format() function would be what you need.
Sincerely,
Craig Vincent