• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set Real Range Document  RSS feed

 
Tran Tuan Hung
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to fill a real (Double type) number in the JTextField but it have no "d" or "f" in the suffix
For example:
I want to fill 56.33, 58.69...but not 5f, 55.68d, 69.35f....
Here is my class:

I still have no solution, please help me to edit the code.
Sorry for my bad english.
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what you need to do.

I believe that the "f" and "d" suffixes are only needed for floating-point literals such as:



Notice that the "f" and "d" suffixes above are within the Java source code.

I see that you are working with strings within a Document object. When you convert the strings to floating-point, I believe that it is the Java code that will determine whether the result is a double or a float, not an "f" or "d" suffix in the String object.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!