fn pad_formats(formats: Vec<Format>, n: usize) -> Result<Vec<Format>, String>