|
-
July 20th, 2010, 05:07 AM
#1
PHP: calculation formular problem
Hi
I have a math. formular which needs some tweaking:
Code:
$row->res_no3 = (($row->input_no3 - $row->e_no3)/$row->perc_no3*100)*($tvolume/1000)/$row->dose_week;
Now it works fine.. but.. if e_no3 is higher than input_no3 it doesn't just result in '0' or null, it "starts from '0' again... meaning:
if
input_no3 = 10
&
e_no3 = 11
it goes below zero, and just displays the value for:
input_no3 = 1
e_no3 = 0
does that make sense? or am I babbling?
it goes into the negative numbers, and show that result.. just without the negative notation '-'
What can be done to prevent this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|