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

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -