Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

I’m writing codes for bukkit (minecraft server) plugin where I run the command tnt[power] which returns power as a string. I want to convert it to float. Can anyone tell me how to do it? 

1 Answer

0 votes
by (19.7k points)

You can use Float.valueOf(String) to convert the String to float. If you want Float(object), use valueOf(). To get a float number, you’ll use parseFloat().

Interested in Java? Check out this Java tutorial by Intellipaat.   

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...