Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

To mutilpy decimal value with negative sign .

Former Member
0 Kudos

Hi ,

I have a decimal value 500.00 and need to multiply it with -1 .

the result however is 500- . I have made some manipulation to get that sign in front ...now it is -500 , but however Iam losing the decimals. Need the value to be -500.00 . Plz Help

Regards,

Sunitha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try as :

data : v_c type p decimals 2 value '500.00'.

data : v_sign(20).

v_c = v_c * -1.

v_sign = v_c.

concatenate '-' v_sign into v_sign.

condense v_sign .

write 😕 v_sign .

3 REPLIES 3

matt
Active Contributor
0 Kudos

Why not post what you tried that didn't work. Then we can probably point out the mistake.

Regards

matt

Former Member
0 Kudos

Try as :

data : v_c type p decimals 2 value '500.00'.

data : v_sign(20).

v_c = v_c * -1.

v_sign = v_c.

concatenate '-' v_sign into v_sign.

condense v_sign .

write 😕 v_sign .

kiran_k8
Active Contributor
0 Kudos

Sunitha,

Just for your info

You can use the function module "CLOI_PUT_SIGN_IN_FRONT " to get the -ve sign to the front. ie when it is 500.00 - is displayed as -500.00

K.Kiran.