Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Help needed  RSS feed

 
Himateja Madala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
Suppose i enter "77777777777" in JTextField and if i do a Double.parseDouble("7777777777") the result is obtained as 7.77777E9

However i dont want the exponential notation...I want the value to be displayed as 777777777 in the text field....
any inputs???
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Report post to moderator
To do number formatting, use NumberFormat or DecimalFormat
 
Campbell Ritchie
Marshal
Posts: 55698
163
  • Mark post as helpful
  • send pies
  • Report post to moderator
You can deal with 777777777 the same way you deal with 123456789.

Please don't post two threads about the same question.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!