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

insert zero

Former Member
0 Likes
534

hi

i look for function that insert zero to fraction with 5 postion after the comma for example if the number is:

4.12

i need that he will be

4.12000

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
496

Yossi,

I think you do'nt need any Function Moudle for this. Just check the below code.

REPORT ZDEC.
Data: dec type p decimals 5 value '4.12'.
 write dec.

Hence you can declare a a variable of type p and decimals 5 and just assign the target value to that. It will automatically get convert.

Enjoy Coding.

Thomas Mann,

Please mark point if you problem got solved.

4 REPLIES 4
Read only

Former Member
0 Likes
496

why dont u write a FM and in the import parameter use the number and no of digits after decimal..

and in the source code:

where dec will b no of decimal place..

do dec times.

concatenate number '0' into number.

enddo.

reward points if it helps

gunjan

Read only

Former Member
0 Likes
497

Yossi,

I think you do'nt need any Function Moudle for this. Just check the below code.

REPORT ZDEC.
Data: dec type p decimals 5 value '4.12'.
 write dec.

Hence you can declare a a variable of type p and decimals 5 and just assign the target value to that. It will automatically get convert.

Enjoy Coding.

Thomas Mann,

Please mark point if you problem got solved.

Read only

Former Member
0 Likes
496

Hi Yossi,

Try following declaration:

data : var1(10) type p decimals 5.

Cheers,

Vikram

Pls mark for helpful reply!!

Read only

Former Member
0 Likes
496

Hi,

You can use the variable with 'TYPE P DECIMALS 5' as the output type.

Regards,

Rajeev