Skip to content

Instantly share code, notes, and snippets.

@LutherBaker
Created May 22, 2014 23:08
Show Gist options
  • Save LutherBaker/0b144738b99dac41fa43 to your computer and use it in GitHub Desktop.
Save LutherBaker/0b144738b99dac41fa43 to your computer and use it in GitHub Desktop.
Cocoa Cheatsheet
// http://stackoverflow.com/questions/13122210/dynamically-format-a-float-in-a-nsstring
int precision = 2;
NSString *whatever=[NSString stringWithFormat:@"My float: %.*f", precision,aFloat];
// Asterisk in place of 2^^ ^^^^^^^^^ int variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment