cancel
Showing results for 
Search instead for 
Did you mean: 

checking a decimal value is negative or not

Former Member
0 Kudos

Hi,

Iam having a value 25000.00- in a variable called sum1.

which is a negative value.

i want to check whether it is a negative value or not.

i tried like

if sum1 LT 0.

statement.

else.

statement.

but this is not working, can anyone help me in this.

Thanks,

Rose.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

Check whether the data type is of P or not if it is char then your code wont work convert it and use

Regards

Shiva

Former Member
0 Kudos

you can also use the following math functions

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

acos -Arcuscosinus -1,1

asin- Arcussinus -1,1

atan- Arcustangens

cos- Cosinus

sin- Sinus

tan- Tangens

cosh- Hyperbelcosinus

sinh -Hyperbelsinus

tanh -Hyperbeltangens

exp -Exponential function for basis e -709, 710

log -Natural logarithm > 0

log10 -Logarithm for basis 10 > 0

sqrt -Square root

Former Member
0 Kudos

Hi camilla,

for displaying you can use

&symbol(<)& Display Leading Sign to the Left

&symbol(>)& Display Leading Sign to the Right