Java tutorial
//package com.java2s; public class Main { public static float getFloat(String floatString) { float number = 0; try { number = Float.parseFloat(floatString); } catch (Exception e) { // TODO: handle exception } return number; } }