comments_number display outside specified span

comments_number doesn’t return the number of comments, it echos it out.

As the codex clearly states:

Use get_comments_number() to retrieve the value.