Below is the code that I have
let interestone = 0.0485
let interesttwo = 0.0625
let interestthree = 0.0725
let months: Double = Double(leasingTextField.text!)!
if months <= 24 {
rentePercentLabel.text = String(format: "%.2f%%", 4.85)
renteLabel.text = String(interestone * (price - payouttwo) / 12 * months)
totalCostsLabel.text = String(price + (interestone * (price - payouttwo) / 12 * months))
leasingafgiftLabel.text = String(payouttwo + restsumtwo +
(interestone * (price - payouttwo) / 12 * months) / months)
}
The line below is the one that is giving me trouble, because instead of performing the two equations and then dividing the months last, what happens is that payouttwo and restsumtwo get added and then the next part is added to that.
leasingafgiftLabel.text = String(payouttwo + restsumtwo +
(interestone * (price - payouttwo) / 12 * months / months))