use abs($value) to absolute value

Wags ;)

-----Original Message-----
From: Stuart Clark [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 19:03
To: perllist
Subject: negative to positive


Hi all

How do i change a negative value to a positive?

EG

$number1 = -100;
$number2 = 50;

$result = $number2 - $number1;


The $result variable would equal -50

I want to change the script so it would equal 50

so something like this $result = makethisapositive($number2 - $number1);
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to