title: Choose the number of decimal points in string interpolation
body: <p>Is there a way to use a variable to decide the number of decimal points in literal string interpolation?</p>
  
  <p>for example if I have something like</p>
  
  <pre><code>f'{some_float:.3f}'
  </code></pre>
  
  <p>is there a way to replace the <code>3</code> with a variable?</p>
  
  <p>The end goal is to add data labels to a bar chart:</p>
  
  <pre><code>def autolabel_bar(rects, ax, decimals=3):
      """
      Attach a text label above each bar displaying its height
      """
      for rect in rects:
          height = rect.get_height()
          ax.text(rect.get_x() + rect.get_width()/2.,
                  height + 0.035,
                  f'{round(height,decimals):.3f}',
                  ha='center',
                  va='center')
  </code></pre>
  
  <p>But I can't think of an easy way to replace the <code>3</code> in the string interpolation with the variable <code>decimal</code>.</p>