借助math库的round函数 #include <math.h> double ext_round(double data, int precision) { double base = pow(10, precision); return round(data * base) / base; } 相关文章: 2021-11-29 2021-11-14 2021-10-19 2021-11-29 2021-11-29 2021-11-29 2022-01-02 2021-12-29