AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem writing doubles with java filewriter

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
timb11783
Guest





PostPosted: Tue Nov 29, 2005 10:29 pm    Post subject: problem writing doubles with java filewriter Reply with quote



I can write strings fine but can't write doubles. Do I have to close
the file and try writing with another method?

Back to top
Roedy Green
Guest





PostPosted: Wed Nov 30, 2005 12:08 am    Post subject: Re: problem writing doubles with java filewriter Reply with quote



On 29 Nov 2005 14:29:02 -0800, "timb11783" <timb_11783 (AT) yahoo (DOT) com>
wrote, quoted or indirectly quoted someone who said :

Quote:
I can write strings fine but can't write doubles. Do I have to close
the file and try writing with another method?

see http://mindprod.com/applets/fileio.html
for how to do almost any i/o.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Back to top
timb11783
Guest





PostPosted: Wed Nov 30, 2005 12:29 am    Post subject: Re: problem writing doubles with java filewriter Reply with quote



This does not help me

Back to top
Roedy Green
Guest





PostPosted: Wed Nov 30, 2005 12:52 am    Post subject: Re: problem writing doubles with java filewriter Reply with quote

On 29 Nov 2005 16:29:53 -0800, "timb11783" <timb_11783 (AT) yahoo (DOT) com>
wrote, quoted or indirectly quoted someone who said :

Quote:
This does not help me

You gave almost no detail of what you were trying to do, so I could
only offer generic advice.

then see http://mindprod.com/applets/converter.html

for how to convert double <-> String
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Back to top
Paulus de Boska
Guest





PostPosted: Wed Nov 30, 2005 11:24 am    Post subject: Re: problem writing doubles with java filewriter Reply with quote

Should be a new file :
FileOutputStream fos=new FileOutputStream (pathname) ;
DataOutputStream dos=new DataOutputStream(fos);

dos.writeUTF( somestring );dos.writeDouble( somedouble );

Paul Hamaker
http://javalessons.com

Back to top
Thomas Fritsch
Guest





PostPosted: Wed Nov 30, 2005 4:21 pm    Post subject: Re: problem writing doubles with java filewriter Reply with quote

timb11783 wrote:
Quote:
I can write strings fine but can't write doubles. Do I have to close
the file and try writing with another method?

What do you want? Write out a double

(1) as a human-readable String
or (2) as 8 raw bytes (IEEE-754 format) ?

--
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.