Format numbers with separators based on locale

Fixes #593.
Merge pull request #611 from ahinz/fix/593/thousands-sep

Format numbers with separators based on locale