This topic is locked
[SOLVED]

 "View AS" for Totals

11/12/2012 12:56:57 PM
PHPRunner General questions
S
StefanoF author

Hi.
I'm using PHPRunner 6.2.
In my project I have a Page List representing monthly costs on different activities, for a whole year.

Depending on the type of cost, the value must be expressed in Hours or K€.

So far I have solved it by defining custom fields, for each month, with the following code :
if ($data["Tipo"]=="MDOi" || $data["Tipo"]=="MDOe")

$value = ceil($data["B_GEN"]);

else

$value = number_format($data["B_GEN"],2,',','.');
The problem is that the code is not working on column total(generated by phprunner) as it shows always 2 decimal places.
Any suggestions ?
Thanks.
Stefano

S
StefanoF author 11/16/2012



Hi.
I'm using PHPRunner 6.2.
In my project I have a Page List representing monthly costs on different activities, for a whole year.

Depending on the type of cost, the value must be expressed in Hours or K€.

So far I have solved it by defining custom fields, for each month, with the following code :
if ($data["Tipo"]=="MDOi" || $data["Tipo"]=="MDOe")

$value = ceil($data["B_GEN"]);

else

$value = number_format($data["B_GEN"],2,',','.');
The problem is that the code is not working on column total(generated by phprunner) as it shows always 2 decimal places.
Any suggestions ?
Thanks.
Stefano


Sorry, I forgot to mention the solution. Here it is.
The problem was that on the TOTAL row the '$data["Tipo"]' was not available therefore the control would have always gone to "FALSE".

As the list was a detail of a different Master page list linked on field "TIPO" , instead o testing $data["Tipo"] I changed the test on the "masterkey1".
Stefano