‎2008 Apr 03 9:05 AM
hi all
I had a requirement to convert -ve value to +ve and +ve to -ve is there any Fm to achieve this.
eg 4.6 to -4.6
or -4.6 to 4.6
Regards
Hitesh
‎2008 Apr 03 9:17 AM
You don't need a Fm to achieve that. Just multiply your numeric value to -1.
sample code:
****************
var1 = 46.
MULTIPLY var1 BY -1.
*************
output will be:
var1 = -46.
or
*********
var1 = -46.
MULTIPLY var1 BY -1.
*********
output will then be:
var1 = 46.
hope this will help...
‎2008 Apr 03 9:13 AM
Hi,
DATA N TYPE P DECIMALS 2.
DATA M TYPE P DECIMALS 2 VALUE '-5.55'.
N = ABS( M ). WRITE: 'ABS: ', N.
Pls. reward if useful....
‎2008 Apr 03 9:17 AM
You don't need a Fm to achieve that. Just multiply your numeric value to -1.
sample code:
****************
var1 = 46.
MULTIPLY var1 BY -1.
*************
output will be:
var1 = -46.
or
*********
var1 = -46.
MULTIPLY var1 BY -1.
*********
output will then be:
var1 = 46.
hope this will help...
‎2008 Apr 03 9:18 AM
why u want to go with the FM . Just multiply the value with -1 .
‎2008 Apr 03 9:18 AM
Multiply the value with -1.
data : v_val type p decimals 2 value '4.6'.
v_val = v_val * -1.
‎2008 Apr 03 9:20 AM
Hi,
eg 4.6 to -4.6
to achive the above one, use the FM
CLOI_PUT_SIGN_IN_FRONT