I want to convert a
std::decimal::decimal128
string
int main(int argc, char** argv) {
std::decimal::decimal128 check1(0.1654689875468);
string ee;
ee=std::to_string(check1);
return 0;
}
I have solved the problem by creating the following function:
std::string ToString(std::decimal::decimal128 dec)
{
long double d(std::decimal::decimal128_to_double(dec));
std::ostringstream oss;
oss << std::scientific << std::setprecision(37) << d;
return oss.str();
}
Later I can use it whenever I need it:
string name= ToString(std::decimal::decimal128_to_double(1.3246546787));
Thanks all for helping.