Skip to content

Commit f6b7648

Browse files
authored
Create format_patch.patch
1 parent df67272 commit f6b7648

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/fmt/format.h b/fmt/format.h
2+
index 5013b81..cdf3f6b 100644
3+
--- a/fmt/format.h
4+
+++ b/fmt/format.h
5+
@@ -34,6 +34,7 @@
6+
#include <cstdio>
7+
#include <cstring>
8+
#include <limits>
9+
+#include <locale>
10+
#include <memory>
11+
#include <stdexcept>
12+
#include <string>
13+
@@ -2753,7 +2754,8 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
14+
}
15+
case 'n': {
16+
unsigned num_digits = internal::count_digits(abs_value);
17+
- fmt::StringRef sep = std::localeconv()->thousands_sep;
18+
+ char sep_char = std::use_facet<std::numpunct<char> >(std::locale(std::setlocale(LC_ALL, NULL))).thousands_sep();
19+
+ fmt::StringRef sep(&char_sep, 1);
20+
unsigned size = static_cast<unsigned>(
21+
num_digits + sep.size() * (num_digits - 1) / 3);
22+
CharPtr p = prepare_int_buffer(size, spec, prefix, prefix_size) + 1;
23+
--

0 commit comments

Comments
 (0)