• Post Reply Bookmark Topic Watch Topic
  • New Topic

Conversion to a Double  RSS feed

 
Sarita KShetty
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to convert a String Object to a Double object. I am doing this using Double.parseDouble((String)Object ). It works fine for certain cases for eg:

if my String Object is 206120206 it converts to a double in the form 2.06120206E8
however for 091910091 it converts it in the form 9.1910091E7

I want the entire number in the output with the 0 like 091910091

Could anyone let me know as to how should i go about doing this.?
 
Priety Sharma
Ranch Hand
Posts: 156
Android Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 0 in the number 091910091 looks redundant.
So if you still want the 0 to be present after the conversion to double.
Then I think you should first collect the 0 or 0's and the reappend the 0 or 0's to the converted number. Then it becomes a string again.
This should be fine if you are using it for display purpose only.

Someone else could provide exactly what you need.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!