Curious about Format function with Phone Number <p>UPDATE (SOLVED): <a href="https://dotnetfiddle.net/6GEJyO" rel="nofollow noreferrer">https://dotnetfiddle.net/6GEJyO</a></p> <hr> <p>I used the following code to format a phone number in a loop with various formats:</p> <pre><code>string PhoneNumber = "9998675309" String.Format("{0:" + formatString + "}", Convert.ToDouble(PhoneNumber)) </code></pre> <p>I need to format phone numbers two slightly different ways. One came out as I expected and the other did not.</p> <p>So, curious, I decided to do a quick console app and see all of the different phone number formatting possibilities I could think of. Here is that result:</p> <p><a href="https://i.stack.imgur.com/UCym5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UCym5.png" alt="http://i.imgur.com/PfKlZfM.png"></a></p> <p>My question is this: Why do some of those come out formatted the way that they seem like they should and others do not? Are there escape characters that are needed for some of them?</p>