diff --git a/VENCalculatorInputView/VENCalculatorInputTextField.m b/VENCalculatorInputView/VENCalculatorInputTextField.m index 2ee8afa..7dc37a2 100644 --- a/VENCalculatorInputView/VENCalculatorInputTextField.m +++ b/VENCalculatorInputView/VENCalculatorInputTextField.m @@ -80,6 +80,9 @@ - (void)calculatorInputView:(VENCalculatorInputView *)inputView didTapKey:(NSStr self.text = subString; } } else if ([key isEqualToString:[self decimalSeparator]]) { + if (self.text.length == 1) { + self.text = [NSString stringWithFormat:@"0%@",[self decimalSeparator]]; + } NSString *secondToLastCharacterString = [self.text substringWithRange:NSMakeRange([self.text length] - 2, 1)]; if ([secondToLastCharacterString isEqualToString:[self decimalSeparator]]) { self.text = subString;