title: C# equivalent to this VB6 string formatting?
body: <p>I'm converting an ancient VB6 program to C# and I came across some VB6 code that looked like this . . . </p>
  
  <pre><code>   Format(part(PI).far_xdev, " #0.000;-#0.000")
  </code></pre>
  
  <p>at first I was confused about the two format fields separated by a semicolon.   But it turns out that in VB6 this means that it uses the first one if the value of the number being formatted is 0 or positive, and the second if it's negative. If there were three formatting  fields it would be positive, negative, and zero; four would be positive, negative, zero and null.</p>
  
  <p>What's the equivalent of this in C# string formatting?     How do I say "use this formating string for a positive number and that one for a negative number"?</p>
  
  <p>(To whoever added the "This question may already have an answer": the problem with that link is that the linked question was asked in reference to some version of BASIC (based on the syntax) and did not explicitly say he was looking for an answer in C#, and neither of the two answers given specifically say they are in C#.  We are left to surmise the languages involved based only on the tags.   I think this new question and the resulting answers are much more clear, explicit and detailed)   </p>