Re: Fractions
| From: | Marco Tabini | Date: | Sat, 16 Nov 2002 18:33:45 +0000 |
| Subject: | Re: Fractions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124735@lists.php.net to get a copy of this message | ||
Supposing you want to display the numbers as decimal values:
$celsius = ($farenheit - 32) * 5 / 9;
Unless, of course, I did not understand your question properly.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-16 at 13:35, Stephen wrote:
> I'm wanting to make a simple PHP script that converts Celsius to
Farenheit, Farenheit to Celsius, Farenheit to Kelvin, and Celsius to
Kelvin. I have the formula but it requires fractions. How can I use
frations in PHP to multiply or divide? If you can't, how could I
substitute doing so? 5/9 (F - 32) is the forumla to get Celsius to
Farenheit if you need it.
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
> "Life is a gift from God. Wasting it is like destroying a gift you got from the person you
love most." -- http://www.melchior.us
> ----
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php