Results 1 to 5 of 5
Thread: Float to String
- 12-28-2007, 11:00 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 70
- Rep Power
- 0
- 12-28-2007, 12:06 PM #2
Member
- Join Date
- Dec 2007
- Posts
- 5
- Rep Power
- 0
to ways to do this.....
Just use it as a string.... As in this example :
String str;
float f = 12.23;
str = "bla bla bla"+f;
the result is a string containing "bla bla bla12.23"
if you just want the float, juste concatenate it to an empty string (str= ""+f; )
OR
explicitly transform it using the appropriate method :
str = f.toString();
ET C'EST CAISSE ;-)
- 12-28-2007, 12:11 PM #3
Member
- Join Date
- Dec 2007
- Posts
- 5
- Rep Power
- 0
You have to consider de float F as an object of the Float class.
because it IS an object of that class.
then check : Float (Java 2 Platform SE v1.4.2)
to know all you can do with that object.
- 12-28-2007, 04:11 PM #4
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
- 12-29-2007, 05:08 PM #5
Member
- Join Date
- Nov 2007
- Posts
- 70
- Rep Power
- 0
Similar Threads
-
String to Float
By durahman in forum New To JavaReplies: 2Last Post: 02-12-2008, 12:17 AM -
convert string to float
By miss_dot in forum NetBeansReplies: 1Last Post: 11-14-2007, 11:26 PM -
Error with convert to Float
By cachi in forum New To JavaReplies: 1Last Post: 08-06-2007, 02:18 AM -
Help with valid declarations of a float
By baltimore in forum New To JavaReplies: 1Last Post: 07-31-2007, 10:28 AM -
Class float
By Peter in forum New To JavaReplies: 1Last Post: 07-08-2007, 01:17 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks