Yet another rounding algorithm