hi all,
i got one scenario that i have got 2 amounts
one is with value 200.00 and other value 100.00-
so now i have to convert 100.00- to 100.00
and comapre that out of 200 & 100 which is greater.
then calculate the profit & loss by subtracting these amount.
u may be confused that why can't we comapre directly 200 & 100-
directly . but let me tell u that it will be problem bcoz if we will subtract 100- from 200 then we will get 300 which will be wrong.
so my requirement is to relace the neagtive sign from the amount
then only compare these two amounts and then only calculate profit & loss.
hi
you have two methods.
first one is add the variables. then 200 and 100- will become 100. that would give u a result.
another method is...
var1 contains '200'.
var2 contains '100-'.
if var2 LT 0. var2 = var2 * ( -1 ). if var1 LT var2. -- -- -- endif. endif.
thx
pavan
hi Sanjeev,
i think there is no need of comparing and then subtracting one value from the other. you just add both those values and if the sum is greater than '0' then it is profit else it means that its a loss.
if i've answered u right award points.
Kiran
Hi,
v1 = abs( 100.00-).
Then compare.
Hi Sanjeev ,
I have a doubt reagading this concept what is you have the values 100 and 200- , then you will get 100 as diffrence , but actually it must be 100-.
Why dont you just add all the values to get the profit/loss details.
Regards
Arun
Add a comment