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

Rounding Off Values.

Former Member
0 Likes
1,276

Hi,

I need to display 2.0000 as 2.00

2.7650 as 2.77

10.7800 as 10.78.

How do I do it.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
639

Hi Renu,

DATA lv_value TYPE p decimals 2.

Now move your value to lv_value it will automatically round it off.

Regards,

Atish

5 REPLIES 5
Read only

Former Member
0 Likes
639

Hi,

Declare another variable with 2 decimal places, pass the actual value to it & then display.

Read only

Former Member
0 Likes
639

hi

try this FM 'FIMA_NUMERICAL_VALUE_ROUND'.It might work.

Regards

Raghav

Read only

Former Member
0 Likes
640

Hi Renu,

DATA lv_value TYPE p decimals 2.

Now move your value to lv_value it will automatically round it off.

Regards,

Atish

Read only

Former Member
0 Likes
639

DATA : num(16) type p decimals 4.
DATA : num2(16) type p decimals 2.


num = '2.7650'.
num2 = num.
write :/ num2.

Read only

Former Member
0 Likes
639

Hi,

Try this.

data: l_value type p decimals 3,

l_output type p decimals 2,

l_output2 type p decimals 2.

l_value = '2.569'.

l_output2 = floor( l_value ).

l_output = frac( l_value ).

l_output2 = l_output2 + l_output.

write:/ l_output2.

Reward points if useful,

Regards,

Niyaz