I have a survey that terminates into another survey, the latter being sort of repository for points. This repository already has some values stored in it, before this current survey terminates into it. I can see the values in the admin module, but seem to be having a difficult time getting the value to work in my math.
The variable in the database is labeled "BaselineQ1" and has a value of of 8-64 depending on the respondent. I need to divide that value by 12, then do some additional math. Right now all that comes out is the addition and multiplication portion, the first and third line of math seem to be getting ignored.
[code]
my $baselineQ1 = GETVALUE("BaselineQ1");
if("Section6" == "done")
{
my $MEC1total1 = $baselineQ1 / 12;
my $MEC1total2 = GETVALUE("MEC1transportationCO2") + GETVALUE("MEC1householdCO2") + GETVALUE("MEC1foodCO2") + GETVALUE("MEC1purchasesCO2");
my $MEC1total3 = $MEC1total1 - $MEC1total2;
my $MEC1total4 = $MEC1total3 * 2200;
$MEC1totals = $MEC1total4;
}
my $intVarTotal = $MEC1totals;
my $roundedTotal = sprintf("%.4f", $intVarTotal);
if($intVarTotal > 0)
{
SETVALUE("MEC1total", $roundedTotal);
}