Refactor rate and amount truncators

The trunc_rate/2 and trunc_amount/2 functions have been replaced by a
single trunc/3 function.