I'm looking to sum two values i have and then display these as a new UILabel.
I've read online about using float however i'm coming unstuck, here's my code below..
The sum i'm looking to do is : shippingLabel (Shipping Costs) + costLabel (Product Price) then having this then accessible in a new UILabel to display (TotalPrice)
The issue i'm having is that the value's are returning as 00.00
//TotalPrice
// Grab the values from the UITextFields.
float ShippingValue = [[shippingLabel text] floatValue];
float CostValue = [[costLabel text] floatValue];
// Sum them.
float floatNum = ShippingValue + CostValue;
TotalPrice.text = [[NSString alloc] initWithFormat:@"%f", floatNum];
TotalPrice = [[UILabel alloc] initWithFrame:CGRectMake(60.0f, 200.0f, 300.0f, 25.0f)];
TotalPrice.textColor = [UIColor colorWithHexString:@"5b5b5b"];
TotalPrice.backgroundColor = [UIColor clearColor];
TotalPrice.font = [UIFont boldSystemFontOfSize:12.0f];
TotalPrice.textAlignment = UITextAlignmentLeft;
[self.view addSubview:TotalPrice];