Java tutorial
//package com.java2s; public class Main { public static boolean IsDecimal(String string) { try { float r = Float.parseFloat(string); return r != r + 1; // just to suppress the hint } catch (Exception e) { return false; } } }