Re: Averages...
| From: | Tim Zickus | Date: | Fri, 22 Dec 2000 02:28:17 +0000 |
| Subject: | Re: Averages... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31354@lists.php.net to get a copy of this message | ||
$avg = $field1 / $field2;
Although that's not really the average, it would be:
$avg = ($field1 + $field2) / 2;
- Tim
> If I have two fields and want to divide one by the other to get an average
> how would I code that?
>
> Example:
>
> Field 1: 500
> Field 2: 5
>
> Average or the result I want: 100