RE: [PHP] Convert number into percentage????
| From: | Alok K. Dhir | Date: | Wed, 10 Apr 2002 23:37:31 +0000 |
| Subject: | RE: [PHP] Convert number into percentage???? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92474@lists.php.net to get a copy of this message | ||
What is a "percentage"? I.e. what do you want as output? The way I
read this, you could want one of two things:
Assuming $x="040" -
1. string "40%"
$percent=intval($x)."%";
2. float 0.40
$percent=round($x/100,2);
> -----Original Message-----
> From:
> php-general-return-92464-adhir=govshops.com@lists.php.net
> [mailto:php-general-return-92464-adhir=govshops.com@lists.php.
net] On Behalf Of Scott Fletcher
> Sent: Wednesday, April 10, 2002 6:13 PM
> To: php-general@lists.php.net
> Subject: [PHP] Convert number into percentage????
>
>
> Hi!
>
> Excuse me if I seem a bit stump on how to convert the
> number to a percentage. I looked up on the function,
> printf() and sprintf() and I'm still a bit stump on that. Is
> there such a php function that would convert this number,
> "040" to a percentage? I hope there is one.
>
> Thanks,
> Scott
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>