This topic is locked

Divide

1/14/2009 6:29:53 PM
PHPRunner General questions
B
bobby123 authorDevClub member

Hi
I am have a problem with a Before Record Add event, I want to use the below calc, but can't get it to work I know its a problem with the divide by 24 I just don't know what.
$values["Days"] = $values["Daily Break"]+$values["Weekly Break"]/24;
Thanks

Bobby123

J
Jane 1/15/2009

Hi,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

B
bobby123 authorDevClub member 1/15/2009

Hi Jane
Thanks for the prompt reply, I take it from your reply that the statement
$values["Days"] = $values["Daily Break"]+$values["Weekly Break"]/24;
Is Ok and would normaly work
Just one note the number 24 in the statement show's in Red, is this the sign of a problem.
What I am trying to do is add the number (Daily Break) to the number (Weekly Break) and then devide it by 24 storing the result in the field Days
thanks
Bobby

J
Jane 1/16/2009

Hi,
try to use this one:

$values["Days"] = ($values["Daily Break"]+$values["Weekly Break"])/24;