This topic is locked

Average and Total percent not formatted

1/30/2007 8:54:33 AM
PHPRunner General questions
S
smaris author

Hi,
Average / Total percent are not formatted correctly. Had a peek into the code and I see that in GetTotals (commonfunctions.php), there is no 'FORMAT_PERCENT' entry.
Updating the GetTotals as follows:
// return Totals string

function GetTotals($value, $stype, $iNumberOfRows,$sFormat)

{

if($stype=="AVERAGE")

{

if($iNumberOfRows)

$value=$value/$iNumberOfRows;

else

return "";

}

if($sFormat == FORMAT_CURRENCY)

$value = format_currency($value);

else if($sFormat == FORMAT_NUMBER)

$value = format_number($value);

*else if($sFormat == FORMAT_PERCENT)

$value = format_number($value
100)."%"; **

if($stype=="COUNT")

return $iNumberOfRows;

if($stype=="TOTAL")

return $value;

if($stype=="AVERAGE")

return $value;

return "";

}
Possible to have this fixed in a next build?
Tnx

J
Jane 1/30/2007

Stefan,
thank you for pointing me to this bug.

We'll fix it in the next PHPRunner update.
You can add this code to the C:/Program Files/PHPRunner3.2/source/include/commonfunctions.php file and rebuild your pages.