You can simply multiply the number by "0.01" (for two decimal places) and use the string format "% .2lf". Write the following code in the textField:shouldChangeCharactersInRange:withString: method textField:shouldChangeCharactersInRange:withString:
NSString *text = [textField.text stringByReplacingCharactersInRange:range withString:string]; text = [text stringByReplacingOccurrencesOfString:@"." withString:@""]; double number = [text intValue] * 0.01; textField.text = [NSString stringWithFormat:@"%.2lf", number]; return NO;
source share