title: Creating comma separated string from numeric values with multiple formats
body: <p>I am creating a string with a list of comma separated values, but these numeric values have different formats. Currently I am using something like this:</p>
  
  <pre><code>var values = new StringBuilder();
  // These are all of type double
  values.AppendFormat("{0:F1},", aLength);
  values.AppendFormat("{0:F4},", anAngle);
  values.AppendFormat("{0:F1},", aHeight);
  values.AppendFormat("{0:F2},{1:F2},", a2DPoint.X, a2DPoint.Y);
  // while these are all of type int
  values.Append(anID).Append(",");
  values.Append(anInt).Append(",");
  values.Append(anotherInt);
  if (aListOfInt.Count &gt; 0)
  {
      values.Append(",");
      values.Append(String.Join(",", aListOfInt));
  }
  
  var resultString = values.ToString();
  </code></pre>
  
  <p>Is this the right way? I could do this also with <a href="http://msdn.microsoft.com/en-us/library/system.string.join%28v=vs.100%29.aspx" rel="nofollow">String.Join</a>, creating beforehand a <code>List&lt;string&gt;</code> similar to the <code>StringBuilder values</code> above, but would it better?
  Is there a more elegant way?</p>
  
  <p>Note: I am new to C#</p>