-->
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: Scientific Notation
PostPosted: Wed Mar 29, 2006 6:14 pm 
Newbie

Joined: Tue Aug 23, 2005 12:46 pm
Posts: 5
Hi All,

I have a question regarding displaying a field without scientific notation. This might not be hibernate question, but I thought some body could help me here.
Here is my question:
We have a number field stored in oracle database as Number(12, 2). In java object, we use a Double type to retrieve this information from the database. On the window/panel, we use echo's TextField component to display the field (by converting Double into string). If the value in the database is ex: 123456789.90, then it displays on the window as 1.234567899E8 (scientific notation, default). But our users doesn't want to see the scientific notation on our web application window.
Can anybody please tell me how to display the number from the database as it is (123456789.90) without scientific notation?

Thanks in advance,
Sirisha.


Top
 Profile  
 
 Post subject: format it
PostPosted: Wed Mar 29, 2006 6:24 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
DecimalFormat df = new DecimalFormat( "################.00")
String v = df.format( double );

http://java.sun.com/j2se/1.4.2/docs/api ... ormat.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.