Hello,
If you have
$a = 24;
$b = 5;
and
$c = $a/$b;
===> $c = 4.8
To retrieve the .8 (reste in french) I saw instruction:
$a%$b
Where can I find a manual for this '%' operator? Of course I already looked in
all the Php manuals (operators, etc ...).
Thanks,
--
Alain Barthélemy
[EMAIL PR
On Tuesday 12 August 2003 10:27 am, Doug Thompson wrote:
> The "%" is called the Modulus operator. It is very briefly explained in
> the PHP manual in table 11-2.
>
> In your example, $mod = $a % $b ==> $mod = 0.8
The modulus is the remainder after division hence 5 into 24 goes 3 times with
a re
from
24/5 try this:
($a/$b)-floor($a/$b)
Regards,
Matt.
-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator
Hello,
If you have
$a = 24;
$b = 5;
and
$c = $a/$b;
===> $c = 4.8
To retrieve
Matt.
-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator
Hello,
If you have
$a = 24;
$b = 5;
and
$c = $a/$b;
===> $c = 4.8
To retrieve the .8 (reste in french) I saw instruction:
$a%$b
Whe
The "%" is called the Modulus operator. It is very briefly explained in the PHP
manual in table 11-2.
In your example, $mod = $a % $b ==> $mod = 0.8
It is a very easy operator to use.
Doug
On Tue, 12 Aug 2003 11:04:39 +0200, Alain Barthélemy wrote:
>Hello,
>
>If you have
>
>$a = 24;
>$b =
On Tuesday 12 August 2003 10:39 am, Phil Driscoll wrote:
> The modulus is the remainder after division hence 5 into 24 goes 3 times
> with a remainder of 4,
oops - 4 times with a remainder of 4 :(
--
Phil Driscoll
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http:
There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 try this:
($a/$b)-floor($a/$b)
Regards,
Matt.
-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator
Hello
thing to do with databases. :)
Regards,
Matt.
-Original Message-
From: Andrew D. Luebke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 3:04 PM
To: 'Alain Barthélemy'; php-db
Subject: RE: [PHP-DB] % operator
Although now that I look at:
http://us4.ph
One day I'll learn to wait until two cups of coffee before attempting to post replies.
On top of which, I have no idea where "0.8" came from. 8-/
Sorry for the confusion factor.
Doug
On Tue, 12 Aug 2003 10:47:21 +0100, Phil Driscoll wrote:
>On Tuesday 12 August 2003 10:39 am, Phil Driscoll