This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing the exponential number into normal readable number format?

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually in my code, floatValue of BigDecimal was taken. for bigger numbers onwards 17548097, it starts losing its precision and starts giving a difference of value 1. So thats why now i decided to take the doubleValue of BigDecimal.

I am just doing this test :

but the output i do get is in exponential form. I want to change it into simple number. How is it this possible ?
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like this is the correct choice to be followed:

I checked using this code, Double value do not precision up to Double.MAX_VALUE
but when i do see this value Double.MAX_VALUE, it comes up in exponential format.

need to change the exponential format number into number represented without exponential format .

 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you want a simple number that's over 300 places long?

if so, you could always use the toPlainString() method of big decimal:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic