Correct mathematical rounding.

Call:

double tsround(double dvalue, int numpos);


Here:

dvalue - the value to be rounded.

numpos - number of decimal places.