title: Division in iOS Xcode
body: <p>Not terribly familiar with Xcode or Objective-C but trying to learn. Hopefully someone can help me out with a problem I'm having.</p>
  
  <p>I have two fields, one called <code>price</code> and one called <code>units</code> and I'm trying divide the inputs of the cells by each other and then display the result with the correct currency of the 'nationality' of the device when a button is pressed.</p>
  
  <p>So far I have of the action of the button I have;</p>
  
  <pre><code>- (IBAction)calculate:(id)sender {
      int x = [price.text floatValue];
      int y = [units.text floatValue];
  
      int calc_result = x / y;
  
      self.result.text = [NSString stringWithFormat:@"%.2f", calc_result];
  
  }
  </code></pre>
  
  <p>which outputs a result into a label field WITHOUT the decimal remainder.</p>
  
  <p>How can I get it to display the decimal remainder to 2 decimal places and put in front the currency found from the 'nationality' of the device. </p>
  
  <p>Thanks in advance!</p>