summaryrefslogtreecommitdiff
path: root/tests/cpp/include/doubl2str.h
blob: 66f2b86a5b4ad1824125edb62b0d30dd4e0b5bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
 *
 *  double -> string
 *
 */

#include <sstream>
#include <iomanip>
std::string double2str(long double d)
{
	std::ostringstream strs;
	strs << std::setprecision(16) << d;
	return strs.str();
}