How to covert Int,Float to String in Swift?

0 votes
230 views
asked Jan 10, 2015 in Swift by admin (8,115 points)
hi

  How to covert Int,Float to String in Swift?

1 Answer

0 votes
answered Jan 10, 2015 by jonathan (3,105 points)

Hi

  Just get the "Descreption" for the variable it will give String value for the specific variabel

EX:

  var title:NSString = NSString()

    var rating = Float()

title = rating.description

commented Jan 10, 2015 by jonathan (3,105 points)
We can use this also
String.localizedStringWithFormat("%.2f", rating)
...