This topic is locked

Red color for negative calculation

2/10/2009 4:28:12 PM
PHPRunner General questions
M
motfuz author

Hi,
How can I color negative numbers red in reports? Or how to color the background of a cell in a table red when the number in the cell is negative (<0)?
Greetings,
Wim

U
Urnso 2/11/2009

hi there,
I use this under Visual editor double click your field and then go to "View As" tab Select "Custom"
I use this for mine:
[codebox]$str = "<table width=100% bgcolor=";

if ($value > "0")

$str.= "#54cf3f";

else

$str.= "#fc516d";
$str.= "><tr><td>".$value."</td></tr></table>";

$value = $str;[/codebox]

M
motfuz author 2/11/2009

Hi Urnso,
Works perfect! Thank you.
Wim