6 Replies Latest reply: May 30, 2009 1:46 PM by Srimani Lalasa

# To delete minus(-) sign

Currently Being Moderated

Hi Experts,

i am calling 'fm' to convert digit amount to words but in print its contains minus(-) sign and because of

that its giving wrong value. the amount is 57,387,916.20- and i have to delete - from this amount.

i am using the syntax :SHIFT AMT RIGHT DELETING TRAILING '-'. but its not working.so please tell me

how to do this.

Thanks.

• ###### Re: To delete minus(-) sign
Currently Being Moderated

Hi,

Whats the data type of the variable AMT? If its Curr then u can use the below code to remove (-).

AMT = AMT * -1.

Else if the variable is char or string just try out the below code.

SHIFT AMT RIGHT DELETING TRAILING '- '

Regards,

Nikhil

Edited by: Nikhil Kayal on May 30, 2009 10:21 AM

• ###### Re: To delete minus(-) sign
Currently Being Moderated

hi,

use

data : a type p decimals 2 value '13245.56-',

b type p decimals 2.

b = abs( a ).

write : b.

• ###### Re: To delete minus(-) sign
Currently Being Moderated

Hi,

Multiply -1.

l_value  type i value '-1'.

l_amount = '57387916.20-'.

l_amount = l_amount * l_value.

Output:- '57387916.20'.

• ###### Re: To delete minus(-) sign
Currently Being Moderated

Dear Saalim,

Best way to change the - ve  is multiply by -1if it is Numeric type. Other wise please convert the -ve sign into + ve sign after getting the value before move to text type.

With Regards,

Selvan.M

• ###### Re: To delete minus(-) sign
Currently Being Moderated

• ###### Re: To delete minus(-) sign
Currently Being Moderated

this is simple

before passing it to fm,

use an if statement and modify the value to positive and send to fm

as follows

if amt < 0.

amt = - amt.

endif.

call 'Fm(what u need).