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: 

conversion of decimal number

Former Member
0 Kudos

hi,

how to convert a decimal number

suppose i want to convert 500.00- to 500.

plz help me in resolving this.

4 REPLIES 4

Former Member
0 Kudos

Ramya,

DATA : v_num type i.

Move : decimal variable to v_num.

Don't forget to reward if useful.

Former Member
0 Kudos

Hi,

Check the below logic:

data: dec type bkpf-KZKRS,

num type numc10,

ch type char10.

dec = '500.00'.

write : / dec.

num = dec.

ch = num.

shift ch left DELETING leading '0'.

write : / ch.

Former Member
0 Kudos

Hi Ramya,

Try this.

data : var type i,

var1(3) type n.

i = -500.

var1 = var.

Regards,

Mohaiyuddin

Former Member
0 Kudos

Hi Ramya,

You can use Field symbol with CASTING operator to convert decimal to Numeric Type (Intergers). You can try with other Numeric type also.

data:wf_int type i,

wf_dec(10) type x.

field-symbols: <fs> type any.

wf_dec = '28'.

assign wf_dec to <fs> casting type i.

wf_int = <fs>.

write wf_int.

kindly reward if helpful.

cheers,

Hema.