Well when getting code post, read over it one last time and found I typed the wrong field in the echo.

I had $total where I should have had $remain_percent.

Oh well... It's the little things....

Now I just got to format results like 0.73333333333333% and I should be good to go...


Pat

"Computers are useless. They can only give you answers." -- Pablo Picasso


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Gerry Danen
Sent: Thursday, May 11, 2006 1:45 PM
To: [email protected]
Subject: Re: [php_mysql] Division question


What's your exact code, Pat?

I get 0.44:

<?php
$remaining = 11;
$total = 25 ;
$remain_percent = $remaining / $total;
echo $remain_percent ;    //    returns 0.44
?>

Gerry


On 5/11/06, Patrick Newberry <[EMAIL PROTECTED]> wrote:
>
> I'm tying to calculate the percentage in a php script
>
>   $remain_percent = $remaining / $total;
>
>   where $remaining = 11 and $total = 25 thus I have:
> 11/25
>
> But when I echo out $remain_percent I get 25.
>
> Any clue as to why?
>
> Pat Newberry
> www.gypsyfarm.com
>
>
>  The php_mysql group is dedicated to learn more about the PHP/MySQL
> web database possibilities through group learning.
>
>
>
>  SPONSORED LINKS
>   American general life and accident insurance
> company<http://groups.yahoo.com/gads?t=ms&k=American+general+life+and+accident+insurance+company&w1=American+general+life+and+accident+insurance+company&w2=American+general+life+insurance+company&w3=American+general+life&w4=American+general+mortgage&w5=American+general+life+insurance&w6=Computer+internet+security&c=6&s=230&.sig=Kzn1J6ZDdsfc3f-9JZ-bKQ>  American general life insurance company<http://groups.yahoo.com/gads?t=ms&k=American+general+life+insurance+company&w1=American+general+life+and+accident+insurance+company&w2=American+general+life+insurance+company&w3=American+general+life&w4=American+general+mortgage&w5=American+general+life+insurance&w6=Computer+internet+security&c=6&s=230&.sig=q5Z_Gheyyf5dB3KHCkTGOw>  American
> general life<http://groups.yahoo.com/gads?t=ms&k=American+general+life&w1=American+general+life+and+accident+insurance+company&w2=American+general+life+insurance+company&w3=American+general+life&w4=American+general+mortgage&w5=American+general+life+insurance&w6=Computer+internet+security&c=6&s=230&.sig=1O42IK5r5LJ1BBWLyTAAKA>   American
> general
> mortgage<http://groups.yahoo.com/gads?t=ms&k=American+general+mortgage
> &w1=American+general+life+and+accident+insurance+company&w2=American+g
> eneral+life+insurance+company&w3=American+general+life&w4=American+general+mortgage&w5=American+general+life+insurance&w6=Computer+internet+security&c=6&s=230&.sig=AC-EcyrN2MPgqHTxt6lmKg>  American general life insurance<http://groups.yahoo.com/gads?t=ms&k=American+general+life+insurance&w1=American+general+life+and+accident+insurance+company&w2=American+general+life+insurance+company&w3=American+general+life&w4=American+general+mortgage&w5=American+general+life+insurance&w6=Computer+internet+security&c=6&s=230&.sig=P8vNlXr7QopQQ3tGIepE4Q>  Computer internet security<http://groups.yahoo.com/gads?t=ms&k=Computer+internet+security&w1=American+general+life+and+accident+insurance+company&w2=American+general+life+insurance+company&w3=American+general+life&w4=American+general+mortgage&w5=American+general+life+insurance&w6=Computer+internet+security&c=6&s=230&.sig=OCFX-MPv3cQROoYDEaexxA>
>  ------------------------------
> YAHOO! GROUPS LINKS
>
>
>    -  Visit your group "php_mysql<http://groups.yahoo.com/group/php_mysql>"
>    on the web.
>
>    -  To unsubscribe from this group, send an email to:
>    
> [EMAIL PROTECTED]<[EMAIL PROTECTED]
> s.com?subject=Unsubscribe>
>
>    -  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>    Service <http://docs.yahoo.com/info/terms/>.
>
>
>  ------------------------------
>



--
Gerry
http://dev.danen.org/


[Non-text portions of this message have been removed]




The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. 
Yahoo! Groups Links








The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning.



SPONSORED LINKS
American general life and accident insurance company American general life insurance company American general life
American general mortgage American general life insurance Computer internet security


YAHOO! GROUPS LINKS




Reply via email to