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: 

Condition: if amount less than 0

Former Member
0 Kudos

Hi abappers,

How come it's not passing when the condition is Amount < 0 where Amount =

0.80. It recognized as greater than 0. The data type is DEC(12,2). What should be the correct statement?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

sorry guys my mistake it's -0.80

6 REPLIES 6

Former Member
0 Kudos

hi,

0.80 is greater that Zero.

Thanks,

Senthil

ThomasZloch
Active Contributor
0 Kudos

0.8 > 0

valid mathematics, no?

prince_isaac
Active Participant
0 Kudos

hie Ella

to make it easier all amounts that are less than zero have a negative sign either leading or trailing.

-0.80 .....0.....0.80

regards

prince isaac

Former Member
0 Kudos

sorry guys my mistake it's -0.80

matt
Active Contributor
0 Kudos

You have

IF A < B....

What are the types of the two variables of A and B? If one or more is actually a character based type, then you'll encounter your problem.

oh... hang on. Try amount < '0.80'.

matt

0 Kudos

Hi

Where is your problem, u need to check if the amount is greater than 0:

DATA: AMOUNT TYPE P.

MOVE '0.80-' TO AMOUNT.

IF AMOUNT => 0.
  ......do something
ELSE.
  WRITE: 'Invalid number'.
ENDIF.

Max