File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes struts2 scientific notation display Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "struts2 scientific notation display" Watch "struts2 scientific notation display" New topic
Author

struts2 scientific notation display

luke yu
Greenhorn

Joined: Oct 20, 2008
Posts: 8
<s:textfield name="assets.unitPrice" maxlength="20" theme="simple" />
it's fine to input 999999999 and it is stored as 999999999.0000 in sql server 2005(i used "money" type) ,but it is displayed in scientific notation formation when i view this field in page. How can i stop this auto convert? i define unitPrice as Double in model.
André-John Mas
Ranch Hand

Joined: Oct 18, 2008
Posts: 37
One approach could simply be to add a getter an setter to your action, which would use a string type. You can then handle the formatting yourself. Something like:

[ November 27, 2008: Message edited by: Andr�-John Mas ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: struts2 scientific notation display
 
Similar Threads
Rounding problem
Scientific notation
help with number formats
Increase the range of Double
format a scientific notation double to a non scientific notation double