A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Float to string n String to Float ex
Sham Jowsaki
Ranch Hand
Joined: May 22, 2001
Posts: 146
posted
Aug 01, 2003 08:38:00
0
Hi All,
Can you pls give me an example of data conversion of
float to
string
string to float
Thanks
Jowsaki
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
13
I like...
posted
Aug 01, 2003 09:28:00
0
float f = 3.0f;
String s = String.valueOf(f);
// This can throw
NumberFormatException
f = Float.parseFloat(s);
[Jess in Action]
[AskingGoodQuestions]
Ransika deSilva
Ranch Hand
Joined: Feb 18, 2003
Posts: 524
posted
Aug 03, 2003 12:14:00
0
You can use
Strnig x = Float.toString(float a) also to convert a float to a string..
SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Float to string n String to Float ex
Similar Threads
Tech Word Game
java.lang
WA #2 ..... word association
wrappers
float
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter