RE: [PHP] Incrementing number by .1 or substracting .1
| From: | Martin Towell | Date: | Fri, 05 Apr 2002 00:41:29 +0000 |
| Subject: | RE: [PHP] Incrementing number by .1 or substracting .1 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-91650@lists.php.net to get a copy of this message | ||
so try something like this
for ($i = 5; $i < 6; $i += .1)
{
echo number_format($i, 1) . ", ";
}
-----Original Message-----
From: Devin Atencio [mailto:dreamboy@aros.net]
Sent: Friday, April 05, 2002 10:37 AM
To: php-general@lists.php.net
Subject: [PHP] Incrementing number by .1 or substracting .1
Dear PHP Users,
I am trying to figure out how to write a script to increase
a number by .1 or decrease a number by .1 but the number needs
to be in the syntax of x.x. For instance the counting of 5.0 to
6.0 would go:
5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0
or vise versa for subtract. How could I do this? Any help would
greatly be appreciated.
Devin Atencio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php