Re: Re[2]: [PHP] percentage problems
| From: | Tyler Longren | Date: | Sat, 22 Sep 2001 22:14:46 +0000 |
| Subject: | Re: Re[2]: [PHP] percentage problems | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68370@lists.php.net to get a copy of this message | ||
Hello,
I tried using the ceil() and floor() functions. They did not help much.
Ceil() set everything to 1%. I tried this:
$percent = $num_games/$total_games;
$percent = round($percent, 1);
But again, some of the percentages are:
0.7%
I also tried assigning the $percent variable the int type, but that didn't
work. Here's an example from doing that:
0.67142857142857%
Any other ideas?
Thank you!!!
Tyler
----- Original Message -----
From: "slavko dervisevic" <slavkod@EUnet.yu>
To: "Matt Greer" <tortus@rcnchicago.com>
Cc: "PHP-General" <php-general@lists.php.net>
Sent: Saturday, September 22, 2001 4:58 PM
Subject: Re[2]: [PHP] percentage problems
> Hello matt,
> even better is ceil() or floor()
> Saturday, September 22, 2001, 11:53:44 PM, you wrote:
> >> Better than substr is to cast the variable to be an int
>
>
> --
> Best regards,
> slavko mailto:slavkod@eunet.yu
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net