藉助math庫的round函數函數
#include <math.h> double ext_round(double data, int precision) { double base = pow(10, precision); return round(data * base) / base; }