string Preprocess::do_fraction(double val,int decplaces)
{
//int prec=numeric_limits<double>::digits10;
char DECIMAL_POINT='.';
ostringstream out;
//out.precision(prec);
out<<val;
string str=out.str();
size_t n=str.find(DECIMAL_POINT);
size_t eposion=str.find('e');
if (eposion==string::npos)
{
if((n!=string::npos)&&n+decplaces<str.size())
{
str[n+decplaces]='\0';
}
str.swap(string(str.c_str()));
}
return str;
}
{
//int prec=numeric_limits<double>::digits10;
char DECIMAL_POINT='.';
ostringstream out;
//out.precision(prec);
out<<val;
string str=out.str();
size_t n=str.find(DECIMAL_POINT);
size_t eposion=str.find('e');
if (eposion==string::npos)
{
if((n!=string::npos)&&n+decplaces<str.size())
{
str[n+decplaces]='\0';
}
str.swap(string(str.c_str()));
}
return str;
}