iPhone How to: UItextField Value to Show Float with Zeros

179

To have a UILabel print out a price float with 2 decimal places you'll want to cast a string with to except a float with 2 decimal places.

myFloatLabel.text = [NSString stringWithFormat:@"$%3.2f", [self.floatValue floatValue]];


0 comments ↓

If you found this post useful click the share this button. Contribute below by adding a comment, no registration is required.


There are no comments yet...Kick things off by filling out the form below.

Leave a Comment