Question with data type in OI
Data type Field1 (quantity) is Decimal, Conversion display is MD2,$
Data type Field2 (price) is Decimal, Conversion display is MD0
It does not work for ans=field1*field2, any advise?
Thanks.
What do you mean by "not work"?
If price is $5.15 and quantity is 10, is the ans=price*quantity
resulting in 5,150?
If so then the fix in r/basic is to divide by 100 like this
ans=price*quantity/100OI (and Arev) store that price as 515, the "MD2" causes the output to be displayed as 5.15 so when you do the math in r/basic you have to do the md2 conversion yourself.
Or is there some other problem?
Personally I like to use
@ans=iconv(oconv(field1,'MD2') * OCONV(FIELD2,'MD0'),'MD2')