How to set a CGFloat to a UILabel's text property

Viewed 14931

I have a UILabel called optionsDisplayerBrushSizeLabel who's text property I want to set to a CGFloat: brushSizeVal. I understand that the text property needs to be a string but I don't know how to convert a CGFloat to an NSString.

2 Answers

You can try:

[NSString stringWithFormat: @"%.2f", myFloat];
Related