title: Why is my integer value stored in a sqlite database limited to a integer 16?
body: <p>I am trying to build an iPad application with Data Entities, linked to a sqlite database.</p>
  
  <p>At a certain moment I am trying to store a numeric value, but my value gets messed up. The maximum value of the field seems to be 32.767 (small int), even though the database column type is an <code>INTEGER</code>.</p>
  
  <p><strong>Code snippet:</strong></p>
  
  <pre><code>- (IBAction)saveValue:(UITextField *)sender {           
  
      switch (sender.tag) {
          case PRICE:
              _property.asked_price = [Converter textToNumber:sender.text];
              break;
          ...
      }
  }
  </code></pre>
  
  <p><strong>Converter.m</strong></p>
  
  <pre><code>+ (NSNumber *) textToNumber:(NSString *) value {
      NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
      [f setLocale: [NSLocale currentLocale]];
      [f setFormatterBehavior:NSNumberFormatterBehavior10_4];
      [f setNumberStyle:NSNumberFormatterDecimalStyle];
  
      NSNumber * tempNumber = [f numberFromString: value];
      [f release];
  
      return tempNumber;
  }
  </code></pre>
  
  <p>So the <code>asked_price</code> property is declared as a <code>NSNumber</code> and the corresponding database field is an <code>INTEGER</code>.</p>
  
  <p>Why is it only allowing me to store values up to 32,767 ? Anything bigger than that becomes some seemingly random value.</p>
  
  <p>Thanks!</p>