string doubleToString(const double &val)
{
char* chCode;
chCode = new char[20];
sprintf(chCode, "%.2lf", val);
string str(chCode);
delete[]chCode;
return str;
}
周赛遇到的数据处理,将double转化为string并保留2位小数
最新推荐文章于 2023-10-10 10:44:35 发布