#pragma mark - 验证金额
+ (BOOL)checkPrice:(NSString *)price {
/*
1.可以输入小数点后两位
2. (1.)这种情况要避免
3. 只能输入非负整数
4.第一位是0,第二位不能是0
*/
//^([1-9]\d*|0)(\.\d?[1-9])?$ 金额
//@"^(0?[1-9]\\d*|0)(\\.\\d?[1-9])?$"; 可01
NSString *pattern = @"^([1-9]\\d*|0)(\\.\\d?[1-9])?$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", pattern];
BOOL isMatch = [pred evaluateWithObject:price];
return isMatch;
}