File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Problem while storing large value in double variable 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 » Java » Java in General
Reply Bookmark "Problem while storing large value in double variable" Watch "Problem while storing large value in double variable" New topic
Author

Problem while storing large value in double variable

Baseet Ahmed
Ranch Hand

Joined: Dec 18, 2006
Posts: 223
Hi,
I want to know the following:

We are calculating the amount for balance.
The value which we are getting is very large,hence causing the value to be converted in exponential format(e.g 12.3E+4).
Now we want to show the users the amount on JSP without exponent symbol.We are using double data type.
Please suggest which data type should I use?
And what other possibilities?


Thank you
Regards
Baseet Ahmed
I.T
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24051
    
  13

It's not the data type -- it's just how you're converting the value to a String. If you use the java.text.DecimalFormat class, it lets you specify exactly what you want your output numbers to look like.


[Jess in Action][AskingGoodQuestions]
Baseet Ahmed
Ranch Hand

Joined: Dec 18, 2006
Posts: 223
Can you provide the example for the same.
(e.g 123.245E47 to be displayed as simple number without exponent.


Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem while storing large value in double variable
 
Similar Threads
Command Pattern with too many Commands!
amount of text - performance
wrong value
Need API: to find difference in two files
Format Currency to indian grouping format