Take the instantaneous rate from the penultimate sample (yet another case of the drop at the end problem), and rationalise the interface to format_sample_details().