views:

504

answers:

1

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.

+1  A: 

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

Ben Gottlieb
I think there should [NSString stringWithFormat: @"%.2f", myFloat]; for floats.
Madhup
you are entirely correct, I've edited my answer, sorry, a typo.
Ben Gottlieb