Application Development and Automation 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: 
Read only

Remove decimal points from variable.

Former Member
0 Likes
1,899

Hi,

I have a little issue.

I have one variable v = 25.000

and i want to remove (.000) from this variable so my result will be only 25 and i want this.

So, is ther any function to remove this?

I want to do it in one shot.

No 2-3 statements.

Points rewarded soon

Regards

RH

8 REPLIES 8
Read only

Former Member
0 Likes
1,385

HI

Declare the variables as

data: v_number type p decimals 0.

Regards

Aditya

Read only

Former Member
0 Likes
1,385

Define one integer type variable and pass the data to it.

data: v_amt type i.

v_amt = 25.000.

Read only

0 Likes
1,385

I need function which doing this !!

Read only

0 Likes
1,385

Hi Ronny,

Calling a function is performance intensive for this functionality. Why do you want to use a function when the same could be attained only by two statements.

Still if you think, the same should be done... you could write your own function module for it with the two lines of code.

Reward points if this helps,

Kiran

Read only

Former Member
0 Likes
1,385

Hi Ronny,

You move this variable data to an integer variable.

Data: v_tempint type i.

move your_variable to v_tempint.

v_tempint will have the required result.

Reward points if this helps,

Kiran

Read only

Former Member
0 Likes
1,385

data: tt type p decimals 3,

ch(10) type c.

tt = '233.453'.

write:/ tt decimals 0.

reward if useful........

Read only

0 Likes
1,385

data: tt type p decimals 3,

ch(10) type c.

tt = '233.453'.

write tt to ch decimals 0.

write:/ ch.

Read only

Former Member
0 Likes
1,385

Hi,

Try FM ROUND.

Thanks,

Sriram Ponna.