1 | #include <iostream>
|
---|
2 | #include <clocale>
|
---|
3 | #include <boost/multiprecision/cpp_int.hpp>
|
---|
4 |
|
---|
5 | int main()
|
---|
6 | {
|
---|
7 | // us locale works just fine as it does not introduce thousands separators
|
---|
8 | //std::locale::global(std::locale("C"));
|
---|
9 | // german locale does not work consistently
|
---|
10 | std::locale::global(std::locale("de"));
|
---|
11 |
|
---|
12 | boost::multiprecision::uint128_t i(9999);
|
---|
13 | boost::multiprecision::uint128_t j("9999999999999999");
|
---|
14 | // should display both numbers consistently w.r.t. thousands separator. Preferably respecting locale imbued.
|
---|
15 | // instead it shows 9.999
|
---|
16 | // 9999999999999999
|
---|
17 | std::cout << i << std::endl << j << std::endl;
|
---|
18 | }
|
---|