Reputation: 11
I have a text file with decimal numbers in it. I am trying to use Integer.valueOf()
in a Java program and it does not convert the decimal numbers.
How do I convert the decimal number string into an int?
Upvotes: 0
Views: 12604
Reputation: 234875
You can use java's Double.valueOf()
defined here instead; then you can convert the resulting double to an int.
Upvotes: 2