title: format a string using .format() to convert a float into dollars and cents left justified in python
body: <p>I am trying to use <code>.format()</code> to convert a float into a dollar amount. I have accomplished that task, however, I have a major problem. I get empty spaces in between the dollar sign and the value. Is there a way for me to have the field length (width of the field) constant and have the "$" next to the number, regardless of the numbers length?</p>
  
  <p>This is what I have tried:</p>
  
  <p><a href="https://i.stack.imgur.com/po4Ly.png" rel="nofollow noreferrer">Screenshot of my console</a></p>
  
  <pre><code>money = 1243432.6
  </code></pre>
  
  <ol>
  <li><p><code>'${:&gt;,.2f}'.format(money)</code><br>Output: <code>'$1,243,432.60'</code></p></li>
  <li><p><code>'${:&gt;10,.2f}'.format(money)</code><br>Output:<code>'$         1,243,432.60'</code></p></li>
  <li><p><code>'${:&gt;20,.2f}'.format(money)</code><br>Output:<code>'$         1,243,432.60'</code></p></li>
  </ol>