summaryrefslogtreecommitdiff
path: root/tests/cpp/include/doubl2str.h
blob: 5c7f208f7411948637ffc841667e409c5c231a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 *
 *  double -> string
 *
 */
#include <sstream>
#include <iomanip>
std::string double2str(long double d)
{
	std::ostringstream strs;
	strs << std::setprecision(16) << d;
	return strs.str();
}