force given value to be nDecimalPlaces
double round( double x, UINT nDecimalPlaces )
x with nDecimalPlaces decimal places.
EX1
void round_ex1() { double x = 34.56789; int nDecimalPlaces = 3; printf("round(%f, %d) = %f", x, nDecimalPlaces, round(x, nDecimalPlaces)); }
Calculates a double value which is equal to x up to nDecimalPlaces decimal places
prec
origin.h