File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read numbers in java

 
teja dharma
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to read numbers in java ?

[edit]Get rid of large red font. CR[/edit]
 
Himalay Majumdar
Ranch Hand
Posts: 324
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Click here.

I suggest its better to do your homework..research on the topic first, before asking questions. Also..Please try using normal font.
 
K. Tsang
Bartender
Pie
Posts: 3226
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What context are you basing your question on? If you want to convert strings to numbers (integer, double etc) then you can use Integer.parseInt(String) or Double.parseDouble(String) etc

The other way round is to use the toString() method of Integer or Double class.
 
Angelika Angley
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From left to the right!
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agree about "normal font." But "left-to-right" is a bit steep, thank you. And we aren't that fond of the "let me Google that for you site." It is however, good for a laugh to try that link and see what it produces

K Tsang is right about Integer.parseInt() and Double.parseDouble(); in fact there are similar methods in most of the subclasses of the Number class (or the subclass constructors) for getting numbers out of Strings.
You can also read a number from a text file, keyboard input, etc, with the nextXXX() methods of the Scanner class.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic