The third argument to val_to_str() is a format string that gets passed the value that couldn't be mapped to a string - it's an integer and needs to be printed with an integer format. Fixes bug 4644.