Hi.
On Sunday 24 May 2009, Ron Piggott wrote:
Is there a way to remove the trailing '0'?
$width = number_format($width,2);
Also is there a way to have the original fraction display (1/4), as well
as have provision for 1/8 and 3/8 and 1/2, etc. display?
On this one I suspect you'd have to
Mark Kelly wrote:
Hi.
On Sunday 24 May 2009, Ron Piggott wrote:
Is there a way to remove the trailing '0'?
$width = number_format($width,2);
Also is there a way to have the original fraction display (1/4), as well
as have provision for 1/8 and 3/8 and 1/2, etc. display?
On this one I
:17 PM
Subject: Re: [PHP] Fractions
how about you try it to see what happens, and maybe learn how it works
Andrew
- Original Message -
From: Stephen [EMAIL PROTECTED]
To: Andrew Brampton [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 12:11 AM
Subject
Just like math...find the greatest common denominator of the numerator
and denominator and then divide each (numerator and denominator) by that
number...
ie: numerator = 8 and denominator = 12
so we have 8/12
then greatest common denominator is 4...
so 8/4 = 2 and 12/4 = 3
thus, 8/12 = 2/3
But how do you find it in PHP?
- Original Message -
From: Ray Hunter [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 6:12 PM
Subject: Re: [PHP] Fractions
Just like math...find the greatest common denominator of the numerator
PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 6:12 PM
Subject: Re: [PHP] Fractions
Just like math...find the greatest common denominator of the numerator
and denominator and then divide each (numerator and denominator) by that
number
Andrew
- Original Message -
From: Stephen [EMAIL PROTECTED]
To: Ray Hunter [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 11:20 PM
Subject: Re: [PHP] Fractions
But how do you find it in PHP?
- Original Message -
From: Ray Hunter [EMAIL
in simpliest
form?
- Original Message -
From: Ray Hunter [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 6:38 PM
Subject: Re: [PHP] Fractions
If there are none in the math functions then you need to create your own
or do a search
Would this also print out as a mixed number if it should?
- Original Message -
From: Andrew Brampton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 09, 2002 6:44 PM
Subject: Re: [PHP] Fractions
Well how would you do it on paper?
$numerator = 8;
$denominator = 12
: Re: [PHP] Fractions
how about you try it to see what happens, and maybe learn how it works
Andrew
- Original Message -
From: Stephen [EMAIL PROTECTED]
To: Andrew Brampton [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 12:11 AM
Subject: Re: [PHP
You gotta be kidding me, no? When did you learn decimals? I think I started
by 3rd or 4th grade ...
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 1:36 PM
To: PHP List
Subject: [PHP] Fractions
I'm wanting to make a simple PHP
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
Well, seeing as you're in the 7th or 8th grade (at least according to your
Website) - my sincere apologies ...
Just use 5.0/9.0 in your formula.
Mark C.
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 1:36 PM
To: PHP List
Subject:
: [PHP] Fractions
Well, seeing as you're in the 7th or 8th grade (at least according to your Website)
- my sincere apologies ...
Just use 5.0/9.0 in your formula.
Mark C.
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 1:36 PM
On Sunday 17 November 2002 03:09, Stephen wrote:
9/5 and 5/9 would be a repeating deicmal. I find fractions would be easier
to multiply then a repeating deicmal.
But php doesn't care one bit (and neither should you) whether you use
echo ( (5/9) * (80-32) );
OR echo ( 0.6 * (80-32)
15 matches
Mail list logo