To format a float to 2 decimal places in Objective-C you can use the following snippet.
Sample Objective-C
NSString* formattedVariable = [NSString stringWithFormat:@"%.02f", myFloatVariable];
All the Code Snippets and Samples you need
To format a float to 2 decimal places in Objective-C you can use the following snippet.
NSString* formattedVariable = [NSString stringWithFormat:@"%.02f", myFloatVariable];
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to format a float to 2 decimal places in #ObjectiveC http://t.co/uxfItKR7rv #ios #iphone #ipad #xcode #mac #osx …
RT @CodeSnippetsNET: How to format a float to 2 decimal places in #ObjectiveC http://t.co/uxfItKR7rv #ios #iphone #ipad #xcode #mac #osx …
RT @CodeSnippetsNET: How to format a float to 2 decimal places in #ObjectiveC http://t.co/uxfItKR7rv #ios #iphone #ipad #xcode #mac #osx …
RT @CodeSnippetsNET: How to format a float to 2 decimal places in #ObjectiveC http://t.co/uxfItKR7rv #ios #iphone #ipad #xcode #mac #osx …
Top story: How to format a float to 2 decimal places in Objective-C http://t.co/UnvK3AB3qm, see more http://t.co/YdpWfHnsVm