Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Another problem  RSS feed

 
Simon Cross
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the last answer would have worked except that I didn't give all the info. The file i am going to input looks a bit like this:
3 147,3
5 167,4
with the three numbers going to a class which draws a graph of some kind.
I can read the numbers using a fileInputStream wrapped in a datainputstream.
I am using the method below to get the numbers from the file.
try {
while (true) {
price = in.readDouble();
in.readChar(); //throws out the tab
unit = in.readDouble();
in.readChar(); //throws out the tab
char chr;

problem is I don;t get 3 but something like 8099827 when displayed as an int. and so number to the e when displaying a double.
Someone explain whats going on please. Thanx
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!