Format Strings -- Pad a double left and right
<p><em>I am almost to embarrassed to ask this very basic question, but:</em></p>

<p>How do you print the following <strong>only using format strings</strong>?</p>

<pre><code>42.315 --&gt;  42.315000
-4.2   --&gt;  -4.200000
315.42 --&gt; 315.420000
</code></pre>

<p><em>if it was not noticable: I require a padding with spaces <strong>before</strong> the comma/dot <strong>and</strong> a zero-padding <strong>after</strong> the comma/dot</em></p>

<p><hr/>
I have the following code to pad the following zeros:</p>

<pre><code>double v1 = 42.315;

return string.Format("v1: {0:F14}", v1);
</code></pre>

<p>And I would normally use <code>&lt;string&gt;.PadLeft(18, ' ')</code> to pad the left side of the string with zeros.<br/>
I do, however, want to avoid <code>string::PadLeft(int, char)</code> and solve this issue purely with <code>string::format(string, params object[])</code>.</p>

<p><hr/>
<em>I am pretty sure, that this has been asked about a hundred times here - though I was unable to find the question(s). But feel free to mark it as a duplicate [only if it is one - of course] ...</em></p>