ChestShop-3/com/Acrobot/ChestShop/Utils/uNumber.java
Acrobot e27cdfb70c - Compatibility with PailStone
- Renamed a lot of things
- Added chest masking option
2011-07-05 19:08:55 +02:00

36 lines
747 B
Java

package com.Acrobot.ChestShop.Utils;
/**
* Checks if string is a numerical value
*
* @author Acrobot
*/
public class uNumber {
public static boolean isInteger(String string) {
try {
Integer.parseInt(string);
return true;
} catch (Exception e) {
return false;
}
}
public static boolean isFloat(String string) {
try {
Float.parseFloat(string);
return true;
} catch (Exception e) {
return false;
}
}
public static boolean isDouble(String string) {
try {
Double.parseDouble(string);
return true;
} catch (Exception e) {
return false;
}
}
}