This fixes #8090.  There was a newline character after the number that was confusing it.  It now uses trim() to remove that.