Jump to content

ajc1502

New Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ajc1502's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you so much, had 3 hours on that one You have a good day..
  2. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.