Hi New but learning fast...
I am trying to achieve echo or printing a $variable which is a number. I would like it to display red if negative or black is positive! I also need to round the number to 0. i.e -34.32345 becomes -34
I have achieved each independently but if I try and add rounding it breaks the code??? So I need to know how to add rounding to the variable $variancemonth in the following code.
<?php
if ($differencemonth <= 0 ){
print "Variance Month <font color=\"red\">£$differencemonth</font>";
}
else {
print "Variance Month <font color=\"000000\">£$differencemonth</font>";
}
?>
Any help would be appreciated.
Regards
Andy
ps I can find examples of both rounding and formatting independently but not used together.