Math operations | Sololearn: Learn to code for FREE!


Math operations

How to multiple age with doubles Theres a date picker and that calculates the age with hours. It displays on a label. I wanna multiply that number with 2. But let ageHours = components.hour İt is not shown as a double or int, how should i make swift detec ageHours as a double or int

12/22/2018 4:14:15 PM


1 Answer

New Answer


Have you tried: let ageHours = Double(components.hour) I’m not familiar with the hour function, but Double() works in other applications