‎2007 Nov 28 10:59 AM
hiiii
value = ( v_rate / v_qty ) * -1
it dont work when i do *-1 any idea what to use
‎2007 Nov 28 11:01 AM
Do like this
value = ( v_rate / v_qty ) * ( -1)
it will work
cheers
‎2007 Nov 28 11:01 AM
‎2007 Nov 28 11:02 AM
declare a variable with type p,it can store a negative value and use it.
Regards,
Amit
Reward all helpful replies.
‎2007 Nov 28 11:03 AM
value = ( v_rate / v_qty ) * ( -1 ).
observe the space before and after -1
‎2007 Nov 28 11:04 AM
Hi,
Do like this.
value = ( v_rate / v_qty ) * ( -1 )
Regards,
Prashant
‎2007 Nov 28 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.
‎2007 Nov 28 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
‎2007 Nov 28 11:12 AM
‎2007 Nov 28 11:13 AM
do you think that because 100.000 is 3 decimal place that why it won't work
‎2007 Nov 28 11:13 AM
check the "fixed point arithmetic" option for your program attributes...
and also check the data type of value
‎2007 Nov 28 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-
‎2007 Nov 28 11:18 AM
‎2007 Nov 29 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
‎2007 Nov 28 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.
‎2007 Nov 30 6:55 AM