Question with data type in OI (OpenInsight 32-bit Specific)
At 06 OCT 2005 11:27:50AM Marc Edwards wrote:
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.
At 06 OCT 2005 04:45PM R Johler wrote:
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?
At 06 OCT 2005 07:22PM Leon Shaffer wrote:
Personally I like to use
@ans=iconv(oconv(field1,'MD2') * OCONV(FIELD2,'MD0'),'MD2')