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

Decimal

Former Member
0 Likes
961

Hi friends,

i have a value for exp 1,56

can i just pick up the non-decimal part

1,56----


> 1

or 45,78----


> 45

i don't want to stock the value as a text using write 1.45 to X, i want to stock it as a numeric value.

Thanks

Soufiane

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
932

Hi..

<b>floor ( w_value )</b> gives u non decimal part.

7 REPLIES 7
Read only

Former Member
0 Likes
932

hi,

move that value to an integer variable.

u will get the ifrst part.

Regards

Reshma

Read only

Former Member
0 Likes
932

Hi,

Define a var as integer and use move to decimal value into the integer var.

Thanks,

Rohan

Read only

Former Member
0 Likes
933

Hi..

<b>floor ( w_value )</b> gives u non decimal part.

Read only

Former Member
0 Likes
932
REPORT YCHATEST1.

DATA : V_NUM TYPE P DECIMALS 2 VALUE '1.45',
       V_INT TYPE I.

V_INT = V_NUM.

WRITE :V_INT.
Read only

Former Member
0 Likes
932

Hai,

Use:

<b>FLOOR(VALUE)</b> to get integer part.

CIEL(VALUE) to get next integer of the integer part

Example Code:

<b>DATA:

W_VAL1 TYPE P DECIMALS 2 VALUE '23.4'.

W_VAL1 = FLOOR( W_VAL1 ).

WRITE:

/ W_VAL1.</b>

Hope this helps you.

Regds,

Rama.Pammi

Read only

Former Member
0 Likes
932

OK THank you so much guys.

Regards,

Soufiane

Read only

Former Member
0 Likes
932

MERCI