Change format to accept integers, not objects

Fixes #1721