Added support for %d flag.

Added documentation.