makiju
14th September 2009, 09:28
Hi,
Is there any solutions to avoid problems with Float decimals?
I have a problem with one customized table which has datatype "float".

Example:
-37.253900000000002

When browsing...this will conflict with other row, which hasn't got that much decimals. But when I try to shorten this, it will not work. I can't make it shorter like -37.2540. It will always be with this kind of crazy value.
Bshell handles these as rounded and this brings problems because it's not rounded in DB. Can only be seen by using unload from dbaccess (or bdbpre).

Database is Informix on AIX (baan4c4)

bdbpre/post is not a solution. This problem happens even when inserting new row via GTM.

sushil
15th September 2009, 07:16
If you are trying to make any program outside baan , then you could try converting into string with fixed decimals.

with functions like "deccvasc()"

http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.esqlc.doc/esqlc444.htm

dave_23
15th September 2009, 08:46
Hi,
Is there any solutions to avoid problems with Float decimals?
I have a problem with one customized table which has datatype "float".

Example:
-37.253900000000002

When browsing...this will conflict with other row, which hasn't got that much decimals. But when I try to shorten this, it will not work. I can't make it shorter like -37.2540. It will always be with this kind of crazy value.
Bshell handles these as rounded and this brings problems because it's not rounded in DB. Can only be seen by using unload from dbaccess (or bdbpre).

Database is Informix on AIX (baan4c4)

bdbpre/post is not a solution. This problem happens even when inserting new row via GTM.

weird, 2 of these on the same day?
Here's my response to the other person in case you missed it.
http://www.baanboard.com/baanboard/showthread.php?t=56761

you can't index float fields, don't even try. I suspect that's why you're getting wrong row returned.

Dave

makiju
15th September 2009, 09:03
That could be a solution. I even tried to switch this table to L2, but it didn't help. This field is part of index5.
...(without index5 it's working fine)

dave_23
15th September 2009, 20:29
That could be a solution. I even tried to switch this table to L2, but it didn't help. This field is part of index5.
...(without index5 it's working fine)

Yup, you'll notice that Baan never indexes a float field. and that's why.

Dave