How to use a segment to select a value then use that value in a formula
<p>I am trying to simply have a segment when selected pick a factor and use it in a formula. The problem i am having is converting the factor  a (float) into a  value a (double) and show this on the display. What am I  doing wrong here?  Seems like an easy fix but I've tried a lot of things to no avail.</p>

<h2>.h</h2>

<p>NSInteger segPicked, var1, var2;</p>

<h2>.m</h2>

<p>var1 = 1100;
var2 = 2.5;</p>

<p><pre><code>
- (void) pickOne:(id)sender {   // Selector for twosegment controller
if (checkCondition == properCondition) {
    segUnit.text = [twoSegments titleForSegmentAtIndex: [SixSegments selectedSegmentIndex]];
     segPicked    = [twoSegments selectedSegmentIndex];</p>

<pre><code>    float factor = 0;   

if (segPicked  == 0 ) {
    factor = 0.28;
    } else if (segPicked  == 1 ) {
          factor = 0.16; 
      }

    double  value = (factor*(var1/var2));     &lt;--- It crashes here..
    Result.text = [NSString stringWithFormat:@"Segment with  = ", value];

}
</code></pre>

<p>}
</pre></code></p>
