avoid scientific notation for large doubles

I apologize in advance, this code really needs cleanup.

fixes #503