Question

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.

Was it helpful?

Solution

You can try:

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

OTHER TIPS

Tray this in swift

var a = String (stringInterpolationSegment:myFloat)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top