mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-05 01:59:41 +01:00
35 lines
744 B
Java
35 lines
744 B
Java
|
package com.Acrobot.iConomyChestShop.Utils;
|
||
|
|
||
|
/**
|
||
|
* Checks if string is a numerical value
|
||
|
* @author Acrobot
|
||
|
*/
|
||
|
public class Numerical {
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|