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 problem

Former Member
0 Likes
615

Hi,

I have a variable with the value 23.6767 and need to find out whether decimal part holds any value. Please let me know any function module to perform this operation.

Thanks in advance.

Regards,

SIva.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

hi siva,

try this logic..

parameter t type p decimals 4 value '23.6767' .

data :d type p decimals 4,

d = frac( t ).

If d is not initial.

Write:/ d.

Endif.

hope this helps ,

vijay.

try this logic by passing value as a parameter or put it in data .

Message was edited by: Vijay

4 REPLIES 4
Read only

Former Member
0 Likes
580

Hi,

use

split var at '.' into var1 var2.

if var2 is initial.

write:/'no decimal value'

endif.

Regards

amole

Read only

Former Member
0 Likes
580

Can't implement the above logic.

According the user settings the '.' and ',' will be changed.

Read only

Former Member
0 Likes
581

hi siva,

try this logic..

parameter t type p decimals 4 value '23.6767' .

data :d type p decimals 4,

d = frac( t ).

If d is not initial.

Write:/ d.

Endif.

hope this helps ,

vijay.

try this logic by passing value as a parameter or put it in data .

Message was edited by: Vijay

Read only

Former Member
0 Likes
580

The simplest way...

lpack like lvalue.

lpack = lvalue MOD 1.

If lpack > 0.

--> it has decimals

endif.