This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Originally posted by Mike Shn: Hello There any method in Java which allow to convert form float to int or from int to String or from String to double? Thanks
float to int: intVal = (int) floatVal; int to String stringVal = Integer.toString(intVal); // or stringVal = "" + intVal; String to double: doubleVal = Double.parseDouble(stringVal);
Here's a perfect spot to introduce you to the Java API -- it shows you all the methods that you can use and how (its just a matter of knowing where to look for it) JDK 1.3.1 API In the upper left click the "java.lang" package Then click on Float, Double and Integer --> you'll see all the methods that Bill mentioned: float to int int to String String to Double