This topic is locked

Mathematical Formula

2/11/2009 7:26:02 PM
PHPRunner General questions
F
fpilot author

I am making a module for construction costing. I am getting information of phase[which can be framing, plumbing,electrical,interlocking,deck etc] then I get Length or width or sq.ft depending upon the phase value and want to process the formula to get the result and am doing something like this:
global $record;

$record["SegmentLength"]=$data["SegmentLength"];

if($record["Phase"]=="Framing Wood"){

return $record["SegmentLength"](12/16)9;

}
But am not getting the desired result,
Also this formula I want to put in a database field so that I can change it while entering the data. Can that be possible?
pls if some one can help.

J
Jane 2/13/2009

Hi,
you need to use Before record added/Before record updated events for this purpose.

Here is just a sample:

if($values["Phase"]=="Framing Wood")

{

$values["SegmentLength"] = $values["SegmentLength"](12/16)9;

}