06-07-2007 12:11 PM
How to conver the negative sign to Positive sign.
Eg: -2.00 to become 2.00
Please guide me.
Thanks in advance.
06-07-2007 12:12 PM
Hi
Use ABS function or multiple it with minus 1
f1 = ABS ( f1 ).
f1 = f1 * -1.
Reward points for useful Answers
Regards
Anji
06-07-2007 12:13 PM
Hi
declare a variable type n.
Then try assigning the negative value to the variable.
Hope this helps.
Tatvagna
06-07-2007 12:13 PM
Hi Vamsi.
move the amount to one charater field and use this FM
use this FM CLOI_PUT_SIGN_IN_FRONT
Thanks,'
Reward If helpful.
06-07-2007 12:19 PM
06-07-2007 12:20 PM
Hi vamsi,
simply:
reverse the sign using
value = - value.
remove the sign:
value = abs( value ).
Regards,
Clemens
06-07-2007 12:25 PM
Hi,
Use ABS function.
Ex.
DATA: T1(10),
T2(10) VALUE '-100'.
T1 = ABS( T2 ).
WRITE T1.
This produces the following output:
100
Two conversions are performed. First, the contents of field T2 (type C) are converted
to type P. Then the system processes the ABS function using the results of the
conversion. Then, during the assignment to the type C field T1, the result of the
function is converted back to type C.
Regards,
Bhaskar