Skip to content

Commit 017801f

Browse files
committed
convert float to string
1 parent 5b1ba3f commit 017801f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

float-to-string.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class floattostring
2+
{
3+
public static void main(String args[])
4+
{
5+
float f=12.3F;//F is the suffix for float
6+
String s=String.valueOf(f);
7+
System.out.println(s);
8+
}
9+
}

0 commit comments

Comments
 (0)