quantity rounding rewrite