验证输入两位小数

/**
* 验证输入两位小数
* 
* @param 待验证的字符串
* @return 如果是符合格式的字符串,返回 <b>true </b>,否则为 <b>false </b>
*/
public static boolean IsDecimal(String str) {
String regex = "^[0-9]+(.[0-9]{2})?$";
return match(regex, str);
}
原文地址:https://www.cnblogs.com/20gg-com/p/6037468.html