From e3b9c971f926ddf05f39eac0e37dd054ffdcdf28 Mon Sep 17 00:00:00 2001 From: YRabbit Date: Wed, 16 Mar 2022 15:05:27 +1000 Subject: [PATCH] BUGFIX: disable the thousands separator The wire numbers are very large and it is undesirable to use a thousand separator there. This is a side effect of enabling locale. Signed-off-by: YRabbit --- common/command.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/command.cc b/common/command.cc index 0de9ccc4..00f900b3 100644 --- a/common/command.cc +++ b/common/command.cc @@ -45,10 +45,17 @@ NEXTPNR_NAMESPACE_BEGIN +struct no_separator : std::numpunct +{ + protected: + virtual string_type do_grouping() const { return "\000"; } // groups of 0 (disable) +}; + CommandHandler::CommandHandler(int argc, char **argv) : argc(argc), argv(argv) { try { - std::locale::global(std::locale("")); + std::locale loc(""); + std::locale::global(std::locale(loc, new no_separator())); } catch (const std::runtime_error &e) { // the locale is broken in this system, so leave it as it is }