Fix #1972: ignore 'comma' for exponent notation.

I added some tests to catch the bug described in #1972, and implemented the fix proposed by @jasondavies, i.e. don't group into thousands in exponent notation mode.

P.S.: First ever pull request attempt. Please be gentle.