Skip to Content

-ve values from table.

hi frnds!

any idea as to how to convert -ve values from db tab in our progs to +ve values. I kno that truncating is one way. is ther any other ??

eg..

i have the values : 1 , -6 , 10 , -5..

i want it to be 22 when i add them up..

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Oct 07, 2005 at 11:57 AM

    Hi !

    1)

    if number < 0.

    number = number * ( -1 ).

    endif.

    2° BEST ONE

    why don't you try ABS? (absolute value)

    don't forget reward!!!!

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 07, 2005 at 11:59 AM

    Hi

    A = abs(A).

    B = B + A.

    Max

    Add comment
    10|10000 characters needed characters exceeded