ENH: add quantize function to truncate data