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
138

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
93

please try with this data declaration.

DATA: CANTIDAD TYPE p decimals 0.

Shreekant

3 REPLIES 3

Former Member
0 Kudos
94

please try with this data declaration.

DATA: CANTIDAD TYPE p decimals 0.

Shreekant

0 Kudos
93

Thanks a lot!

Regards

Former Member
0 Kudos
93

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.