Fix issue where thousands separator was being applied to HTML entities

Fixes #272