title: Change the format of values in a Plotly pie chart (in Python)
body: <p>I'd like to make a pie chart in Python with plotly that displays amounts of money. The following code shows a minimal working example:</p>
  <pre><code>import pandas as pd
  import plotly.express as px
  
  data = {&quot;Name&quot;: [&quot;Stocks&quot;, &quot;ETF's&quot;, &quot;Cash&quot;], &quot;Value&quot;: [1000, 2000, 3000]}
  df = pd.DataFrame(data)
  figure = px.pie(df, values='Value', names='Name',
                  title='Fund Distribution')
  figure.update_traces(textposition='inside', textinfo='percent+label+value')
  
  figure.show()
  </code></pre>
  <p>Which yields the following figure:
  <a href="https://i.stack.imgur.com/9WSnC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9WSnC.png" alt="enter image description here" /></a></p>
  <p>But, it'd like to format the values. I.e. $3,000 instead of just 3000.
  I found <a href="https://stackoverflow.com/q/37461827/13706389">this question regarding the same problem in R</a> but nothing in Python.</p>
  <p>Thanks a lot.</p>