• Post Reply Bookmark Topic Watch Topic
  • New Topic

Decimal problem  RSS feed

 
Paras Ahuja
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to read data from an excel sheet in a GUI developed using Swings.
Whenever the sheet contains a numeric value like 1,2,220 etc... ,it is uploaded in GUI as 1.0,2.0,220.0 etc...
I don't want these decimals. Any idea how to do that?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swings != Swing (SwingIsAProperNoun)


I don't want these decimals. Any idea how to do that?

Use an int
 
Paras Ahuja
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using it as String because the excel may also contain text values for those fields.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Format the String (see String#format(...)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!