ios - Integer Division ('Int' is not convertible to 'Double') -


i comming c# , started checking swift ios , got following issue...

i want convert pence amount pounds , finding problem integer division in swift. following error getting.

enter image description here

what can't understand is, works ok in line 38 way same erroring in line 40 when using variable.

edits

decval1 = 23.4 correct. why decval2 can't have same?

in swift cannot math different types (in case int , double). int , uint not interchangeable.

you have create new instances of matching type

var mynumber : int = 2340 var doublediv : double = double(mynumber) / 100.0 

the decimal places in literals not necessary in cases, clearer use same signatures.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -