format_num method