-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Float precision
PostPosted: Tue Dec 13, 2005 7:45 am 
Newbie

Joined: Tue Dec 13, 2005 7:38 am
Posts: 1
Hibernate version:3.0 beta 1

Hi,

Im wondering how can i change my query precision to retrieve the expected results.

I have a column of type float with several decimal digits, but when query the column in my application the values returned are always truncated to 6 digits, and the decimal degitis vary due the fixed part...

Example:

38.1234567 comes 38.1234
9.12345678 comes 9.12345

Hbm example:

...
<property
name="longitude"
type="java.lang.Float"
column="longitude"
length="12"
precision="8"
scale="8"
/>
...

I have changed my hbm file to have precision and scale but was useless.

When i execute the query in Mysql the results are displayed correctly.

Does any one knows how to have full precision?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 2:11 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Did you check to see if your JDBC driver is the culprit? Otherwise, you'll probably have to provide more information (code, SQL output) before anyone can try to help you.

_________________
nathan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.