借助Round()四舍五入函数:
#include <iostream>#include <string>using namespace std;int main(){string str = "2.86923e-010";double qwe = std::stod(str);double ada = round(qwe * 100) / 100.0;return 0;}
时间:2023-11-05 05:41:26
借助Round()四舍五入函数:
#include <iostream>#include <string>using namespace std;int main(){string str = "2.86923e-010";double qwe = std::stod(str);double ada = round(qwe * 100) / 100.0;return 0;}