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: 

Remove (-) from amount value 1000-

Former Member
0 Kudos
136

Hi Experts,

We need to check if a value contains ' - ', if so, remove the ' - ' sign and display the value. Can anyone guide on how to achieve this?

Thanks a lot.

T

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
110

Hi Tush Mangad,

Multiply it with -1

if v_value < 0.
v_value = -1 * v_value.
endif.

Regards,

ravi

Edited by: Ravi Kanth Talagana on Apr 24, 2009 1:51 PM

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos
111

Hi Tush Mangad,

Multiply it with -1

if v_value < 0.
v_value = -1 * v_value.
endif.

Regards,

ravi

Edited by: Ravi Kanth Talagana on Apr 24, 2009 1:51 PM

amit_khare
Active Contributor
0 Kudos
110

Just use 'NO-SIGN' when moving to the output. You don't have to check for the sign then.

Former Member
0 Kudos
110

Hi,

You can use ABS

EXAMPLE:

w_wrbtr = ABS( w_wrbtr ).

regards

Krishna

kanishakgupta1
Contributor
0 Kudos
110

replace all occurences of '-' in amount with ' '.

Former Member
0 Kudos
110

v_notification = '2001234-'.

if v_notification ca '0'.

REPLACE ALL OCCURRENCES OF '-' IN V_NOTIFICATION with ' '.

endif.

Thanks

Naveen.

0 Kudos
110

HI naveen,

The statement

"if v_notification ca '0'. " will check if v_notification contains any 0 and does not check if the value is negative.

It should be

if v_notification ca '-'. instead.

Regards,

Ravi Kanth Talagana