- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if ([string length]>0)
{
unichar single=[string characterAtIndex:0];//当前输入的字符
if ((single >='0' && single<='9') || single==',')//数据格式正确
{
return YES;
}else{
return NO;
}
}else{
return YES;
}
}