-->
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: I have a problem with java.lang.Float, i need your help.
PostPosted: Wed Nov 26, 2003 5:27 am 
Newbie

Joined: Fri Oct 03, 2003 1:59 am
Posts: 1
My project use Hibernate.

The problem is , the filed in database is numeric(18,2). but the java basic type float only expression the numeric with 4byte.

if a var "float 123456.78" it will be print as "123456.8",;

that's not sitable for my Project, i need a little more excatly reulst,

can you tell me how can i do , without using java.lang.Double.

Thank you!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 9:44 am 
Newbie

Joined: Tue Nov 25, 2003 5:05 pm
Posts: 18
I hate to tell you that this is'nt possible with double or float either. You'll have to use BigDecimal to get the precision you want.
BigDecimal will do BCD-Arithmetic versus normal float arithmetic in the case of double or float.

ciao
Sven


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.