Page 1 of 1

Negative Interger to positive.

Posted: Mon Aug 11, 2003 2:06 pm
by Etherguy
I know I am going to be kicking myself for this one, but how would I go about displaying a negative integer as a positive?

What I am trying to do is print the difference in weight as a whole number. Either you lost 5 pounds or you gained 5 pounds. Simple math, but looks funny saying hey there fatso you gained -5 pounds instead of great job you lost 5.

Any help would be greatly appreciated.

Regards.

Posted: Mon Aug 11, 2003 2:09 pm
by daven
$absolute_value=abs($number)

Posted: Mon Aug 11, 2003 2:14 pm
by Etherguy
Thanks... new I would be kicking myself.

Regards.