double dumpSize = (1024000000.1415926535897932384 * 1.0) / 1024 / 1024;
string tempStr = to_string(dumpSize);
std::stringstream ss;
ss << setiosflags(ios::fixed) << std::setprecision(1) << dumpSize; //此处1代表保存N为小数
tempStr = ss.str();
转载于:https://www.cnblogs.com/gd-luojialin/p/11316735.html