format_stats function

Format statistical results