Expose a format_amount function