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 susp
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
L PROTECTED]>
Sent: Monday, December 09, 2002 7: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 PROTECTE
t;
Sent: Monday, December 09, 2002 7: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" <[EMA
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
on 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
t look like the above
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 ho
om: "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
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...fi
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
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)
t: RE: [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, 20
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: [P
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 progr
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 scri
15 matches
Mail list logo