xcode - BMI calculator compiler error swift -



xcode - BMI calculator compiler error swift -

var bmivalue = (weighttextfield*703)/(heighttextfield*heighttextfield)

my error:

cannot invoke '/' argument list of type '(($t5), ($t11))'

i had made effort on making simple bmi calculator function have typed out brings compiler errors. can please help me. give thanks much.

this solution , converts uitextfields text floats , assign bmi value float variable.

var weight = (weightltextfield.text nsstring).floatvalue var height = (heighttextfield.text nsstring).floatvalue var bmivalue = (weight*703)/height

hope helps .

xcode swift

Comments