title: Decimal style improvement objective c calculator
body: <p>I'm doing the calculator tutorial for iOS and I've done some research for doing the decimal style. So far on my research, I've gone through this code below</p>
  
  <pre><code>- (IBAction)digitPressed:(UIButton *)sender {
      NSString *digit = sender.currentTitle;
      NSString *decimal = @".";
      BOOL decimalAlreadyEntered = [self.display.text rangeOfString:decimal].location == NSNotFound ? NO : YES;
  
      if (self.userIsInTheMiddleOfEnteringANumber) {
          if (([digit isEqual:decimal] &amp;&amp; !decimalAlreadyEntered) || !([digit isEqual:decimal])) {
              [self.display setText:[[self.display text] stringByAppendingString:digit]];
          }
      }
      else if ([self.display.text isEqual:@"0"] &amp;&amp; digit == decimal){
          [self.display setText:[[self.display text] stringByAppendingString:digit]];
          self.userIsInTheMiddleOfEnteringANumber = YES;
      }
      else {
          [self.display setText:digit];
          self.userIsInTheMiddleOfEnteringANumber = YES;
      }
  }
  </code></pre>
  
  <p>This code helped me to prevent multiple decimal points being pressed by the user, and limit it only to one (as in 2.09). Cool! However during the start of the app, when I press on the decimal point and pressed on a number, say 1,  the label will only display ( .1) instead of (0.1) . Any help for the improvement is much appreciated :)  </p>