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