static string BuildFormatString(Sample s) { var fs = s.GetFormat(); return "{0,-18}{1,10:F2}{2,10:F2}{3,10:F2}{4,10:F2}{5,10:F2}{6,10:F2}".Replace("F2", fs); }