fractional-rounding function

Generalized rounding to the nearest fraction of a specified denominator