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

help in small code

Former Member
0 Likes
468

DATA : A(2) TYPE N,

B TYPE N.

A = 11.

IF A GE 10.

B = A / 10.

ENDIF.

WRITE : / B.

b = 1

if a = 19

b = 2.

I want here b = 1

when a = 20 or greater than 20

thats when b = 2

let me know how to do this.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
454

try the following

B = floor( A / 10 ).

3 REPLIES 3
Read only

Former Member
0 Likes
454

Hi

Use ROUND or FLOOR or CEIL or some other maths functions here

you will get it

see this

abs -Absolute value of the argument arg

sign- Plus/minus sign of the argument arg: -1, if the value of arg is negative; 0 if the value of arg is 0; 1 if the value of arg is positive.

ceil -Smallest integer number that is not smaller than the value of the argument arg.

floor- Largest integer number that is not larger than the value of the argument arg.

trunc- Value of the integer part of the argument arg

frac- Value of the decimal places of the argument arg

Regards

Anji

Read only

Former Member
0 Likes
455

try the following

B = floor( A / 10 ).

Read only

0 Likes
454

Thanks

Your solution solved my problem