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: 

How can I format a F type?

former_member384574
Active Participant
0 Kudos
142

Hi experts!

I need help,

TYPES: dato TYPE F.

DATA: CANTIDAD TYPE dato.

CANTIDAD = 1200/ 5

And this return me 2.4000000000000000E+02 I need to format this number into 240 can anybody tell me how?

Thanks a lot

Regards,

Rebeca

1 ACCEPTED SOLUTION

Former Member
0 Kudos
97

please try with this data declaration.

DATA: CANTIDAD TYPE p decimals 0.

Shreekant

3 REPLIES 3

Former Member
0 Kudos
98

please try with this data declaration.

DATA: CANTIDAD TYPE p decimals 0.

Shreekant

0 Kudos
97

Thanks a lot!

Regards

Former Member
0 Kudos
97

Hi,

you can do it as shreekant said, or assign the result back to a variable of type p.

TYPES: dato TYPE F.

DATA: CANTIDAD TYPE dato.

data: result type p decimals 0.

CANTIDAD = 1200 / 5.

result = CANTIDAD.

write: CANTIDAD,

result.