11-28-2007 10:59 AM
hiiii
value = ( v_rate / v_qty ) * -1
it dont work when i do *-1 any idea what to use
11-28-2007 11:01 AM
Do like this
value = ( v_rate / v_qty ) * ( -1)
it will work
cheers
11-28-2007 11:01 AM
11-28-2007 11:02 AM
declare a variable with type p,it can store a negative value and use it.
Regards,
Amit
Reward all helpful replies.
11-28-2007 11:03 AM
value = ( v_rate / v_qty ) * ( -1 ).
observe the space before and after -1
11-28-2007 11:04 AM
Hi,
Do like this.
value = ( v_rate / v_qty ) * ( -1 )
Regards,
Prashant
11-28-2007 11:05 AM
Hi,
Do Try this..
DATA:X type i value '2'.
DATA:y type i Value '10'.
DATA:Value type i.
Value = ( Y / X ) * ( -1 ).
Write:/ Value.
11-28-2007 11:10 AM
i though the problem is in the negative but when i break the formula
value = 20.10 / 100.000
return me 0
11-28-2007 11:12 AM
11-28-2007 11:13 AM
do you think that because 100.000 is 3 decimal place that why it won't work
11-28-2007 11:13 AM
check the "fixed point arithmetic" option for your program attributes...
and also check the data type of value
11-28-2007 11:16 AM
hi, i tried like
DATA:value TYPE p decimals 3.
DATA:x TYPE i VALUE '20.10'.
DATA:y TYPE i VALUE '100.00'.
value = x / y .
WRITE:/ value.
and its giving me 0.200
and
DATA:value TYPE p decimals 3.
DATA:x TYPE i VALUE '20.10'.
DATA:y TYPE i VALUE '100.00'.
value = ( x / y ) * -1 .
WRITE:/ value.
giving me 0.200-
11-28-2007 11:18 AM
11-29-2007 5:28 AM
thx . the problem was not to multiply by a negative
but the fix point . my program is an include . i went to the attributes but i can't find the check box help plzzz
grateful to u
11-28-2007 11:21 AM
Hi,
See Below Code..
DATA:X type P Decimals 2 value '12.12'.
DATA:y type P Decimals 2 Value '100.12'.
DATA:Value type p DECIMALS 3.
Value = ( Y / X ) * ( -1 ).
Write:/ VALUE.
11-30-2007 6:55 AM