| 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
|
|
|
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.
|
 |
 |
|
|
subject: Problem while storing large value in double variable
|
|
|