@Test public void isNumber() throws Exception { Assert.assertTrue(MathUtils.isNumber("121.57")); Assert.assertTrue(MathUtils.isNumber("121")); Assert.assertTrue(MathUtils.isNumber("999999999999")); Assert.assertFalse(MathUtils.isNumber("a12")); Assert.assertFalse(MathUtils.isNumber("0xFF")); }
public static boolean isNumber(String numberString) { try { Double.parseDouble(numberString); return true; } catch (NumberFormatException ex) { return false; } }
MathUtils { public static boolean isNumber(String numberString) { try { Double.parseDouble(numberString); return true; } catch (NumberFormatException ex) { return false; } } }
MathUtils { public static boolean isNumber(String numberString) { try { Double.parseDouble(numberString); return true; } catch (NumberFormatException ex) { return false; } }  }
MathUtils { public static boolean isNumber(String numberString) { try { Double.parseDouble(numberString); return true; } catch (NumberFormatException ex) { return false; } }  static boolean isNumber(String numberString); static boolean isInteger(String numberString); static boolean isLong(String numberString); static int parseInt(String numberString); static long parseLong(String numberString); static double round(double sourceNum, int scale); static int castToInt(Object value); static long castToLong(Object value); static double castToDouble(Object value); static int castToIntNoException(Object value); static long castToLongNoException(Object value); static double castToDoubleNoException(Object value); }
MathUtils { public static boolean isNumber(String numberString) { try { Double.parseDouble(numberString); return true; } catch (NumberFormatException ex) { return false; } }  static boolean isNumber(String numberString); static boolean isInteger(String numberString); static boolean isLong(String numberString); static int parseInt(String numberString); static long parseLong(String numberString); static double round(double sourceNum, int scale); static int castToInt(Object value); static long castToLong(Object value); static double castToDouble(Object value); static int castToIntNoException(Object value); static long castToLongNoException(Object value); static double castToDoubleNoException(Object value);  }