views:

121

answers:

1
// stampDuty percentages
    float stamp1 = (invalue * 1 / PCENT);
    float stamp2 = (invalue * 2 / PCENT);    // #defined PCENT as 100

// stamp duty
    NSNumber *stampN1 = [NSNumber numberWithFloat:stamp1];
    NSNumber *stampN2 = [NSNumber numberWithFloat:stamp2];

// then goes to 
// Stamp Duty invalue is entered in the textfield by user
    if (invalue <= 125000.0f) {

    NSLog(@"Equal to or under 175,000 1% Stamp Duty");

//stampN0
   [lblIntrest setText:[NSString stringWithFormat:@"Stamp Duty: %@", [currencyStyle stringFromNumber:stampN1]]];    
//  need a common variable variable is picked up here
// the value that is calculated here is used with other totals to create a grand final total


    }

    if (invalue >= 125001.0f && invalue <= 250000.0f) {

        NSLog(@"Greater than 125,000 and less than 250,000 StampDuty 1%%");
            [lblIntrest setText:[NSString stringWithFormat:@"Stamp Duty: %@",[currencyStyle stringFromNumber:stampN2]]];
//   need a common variable is picked up here

    }

// returns with the appropriate value
//the value that is calculated here is used with other totals to create a grand final total.
//  eg float Beven = (invalue + SaleP + stamp1 etc etc

If I use stamp1 in the above calculation it works fine. What I'm looking for is a common variable to enter into this calculation variable "string". There are other if statements. Hope you can help

+1  A: 

I suggest the variable name actualStampValue.

Also note, your code contains two errors:

  1. Your first if checks that the number is <=125000, but the string it prints says 175000.
  2. Your second if checks that the number is >=125001, which leaves out all the values in between 125000 and 125001. This check should be >125000.
David Kanarek