How to convert Double to Int in Swift?

You can use:

Int(yourDoubleValue)

this will convert double to int.

or when you use String format use 0 instead of 1:

String(format: "%.0f", yourDoubleValue)

this will just display your Double value with no decimal places, without converted it to int.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)