%b => Binary integer %c => Single character %d => Decimal integer %e => Decimal integer displayed in exponential form %f => Floating point number %g => Same as %e if exponent is less than -4, %f otherwise %o => Octal integer %s => String %u => Unsigned decimal integer %x => Hexadecimal integer %02d => 0 padded two digits %.02f => round to the hundredths
cheat sheets.
$ cheat sprintf( add new | see all )
- updated sheets

- boyfriend
- girlfriend
- loose_weight
- nils
- administrateme
- okay
- bartleby
- xpath
- readme
- git
- sprintf
- shoulda
- nonsense
- lucene_query_syntax
- rspec
Advertisement