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

prob with decimal point

Former Member
0 Likes
689

hi all,

i'm having a record with value 12345.6 This shall be rounded to 12345 and not to 12346 in output.

can anyone tel me the solution for this..

thanks

sunny.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
672

Hi,

data : val type p decimals 2.

declare like that.

then that variable value shows decimals in output.

Reward if useful.

Regards,

Narasimha

5 REPLIES 5
Read only

Former Member
0 Likes
672

Hi,

Do the declaration like this.

data : v_num type P decimals 0.

v_num = 12345.6

write : / v_num.

output : 12345.

Hope it helps you.

regards

Sandeep Reddy

Read only

0 Likes
672

as per ur answer i'm getting 12346 in output.but i need 12345.

can u pls once again go through it.

can u pls suggest me any FM is there?

Read only

matt
Active Contributor
0 Likes
672

Use the ABAP function TRUNC.

matt

Read only

0 Likes
672

[Thread: decimal point|;

Regards,

Isaac Melendez

Read only

Former Member
0 Likes
673

Hi,

data : val type p decimals 2.

declare like that.

then that variable value shows decimals in output.

Reward if useful.

Regards,

Narasimha