Merge pull request #949 from yrabbit/thousands

BUGFIX: disable the thousands separator
This commit is contained in:
gatecat 2022-03-16 07:02:35 +00:00 committed by GitHub
commit 74783c0c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,10 +45,17 @@
NEXTPNR_NAMESPACE_BEGIN NEXTPNR_NAMESPACE_BEGIN
struct no_separator : std::numpunct<char>
{
protected:
virtual string_type do_grouping() const { return "\000"; } // groups of 0 (disable)
};
CommandHandler::CommandHandler(int argc, char **argv) : argc(argc), argv(argv) CommandHandler::CommandHandler(int argc, char **argv) : argc(argc), argv(argv)
{ {
try { try {
std::locale::global(std::locale("")); std::locale loc("");
std::locale::global(std::locale(loc, new no_separator()));
} catch (const std::runtime_error &e) { } catch (const std::runtime_error &e) {
// the locale is broken in this system, so leave it as it is // the locale is broken in this system, so leave it as it is
} }