title: How to format number column in pyspark?
body: <p>I want to format the number of a column to comma separated ( currency format ).</p>
  <p>for example - i have column</p>
  <p><a href="https://i.stack.imgur.com/6k3qL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6k3qL.png" alt="input column" /></a></p>
  <p>the output should be</p>
  <p><a href="https://i.stack.imgur.com/uYU4Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uYU4Y.png" alt="output column" /></a></p>
  <p>I have tried using <code>'{:,.2f}'.format(col(&quot;value&quot;))</code> but i am unable to apply this function by creating udf.</p>
  <p>NOTE: There are also null values present in the column.</p>