Ticket #12211: bug_multiprecision_locale_str.cpp

File bug_multiprecision_locale_str.cpp, 659 bytes (added by Tassilo Glander <tassilo.glander@…>, 6 years ago)
Line 
1#include <iostream>
2#include <clocale>
3#include <boost/multiprecision/cpp_int.hpp>
4
5int 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}