title: How to format float columns of dataframe to desired decimal places while writing into delimited file?
body: <p>So my dataframe has a bunch of columns for pricings which hold values like 16.99 for 16 dollars and 99 cents. I want my pricing to be correct till cents. But while exporting it to csv, it truncates pricing by removing last zero in cases where cents are multiples of 10 (e.g. 16.50 turns into 16.5). Formatting it or even formatting and then parsing it as string does not help:</p>
  <pre><code>for col in df.columns:
      if col.__contains__('USD'):
          df[col] = '$'+df[col].round(decimals=2).astype(str).str.strip()
  df.to_csv('pricing.txt', '\t')
  </code></pre>
  <p>No matter how any decimals I pass there as arguments it does not work. Current workaround is to write a separate function with conditional formatting but is there a way to do it via <code>pandas</code> itself.</p>