Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Decimal field
Tue, Sep 28 2010 12:27 AMPermanent Link

Jeff Dunlop

I have a field that is playing up a bit. It's defined as DECIMAL(20,2). At one point unrounded data was saved into the field, something like 20.32000000000000000000000001. Now, I can't retrieve the field's value in any form, with all attempts to inspect it throwing invalid floating point operation. If I manually edit the field in Manager to 20.32, the error goes away.

Am I missing something, or did something go wrong in the conversion on the way down to the database.
Tue, Sep 28 2010 12:36 AMPermanent Link

Jeff Dunlop

And why is Manager able to display it?
Wed, Sep 29 2010 6:56 AMPermanent Link

Richard Harding

Wise Nutrition Coaching

Jeff,

>>I have a field that is playing up a bit. It's defined as DECIMAL(20,2). At one point unrounded data was saved into the field, something like 20.32000000000000000000000001.

The precision for DECIMAL & NUMERIC is always 19.  (Check out Exact Numeric Types in the manual).  Changing the definition to DECIMAL (19,2) might make a difference.

Richard Harding
Sun, Oct 3 2010 1:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jeff,

<< I have a field that is playing up a bit. It's defined as DECIMAL(20,2).
At one point unrounded data was saved into the field, something like
20.32000000000000000000000001. Now, I can't retrieve the field's value in
any form, with all attempts to inspect it throwing invalid floating point
operation. If I manually edit the field in Manager to 20.32, the error goes
away. >>

How are you retrieving the field value ?  Via SQL or via code ?  If the
value can be displayed in the EDB Manager, then you should be able to
retrieve it via code.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image