Objective-C how to print out leading 0 for a float?

Viewed 6060

How do you print out leading zeros for a float using the NSString type?

Input: 3.14
Desired output: 03.1

Using format @"%02.1f"
Output: 3.1
2 Answers
Related