-1

I have:

    print('Average BTC Left: {:2f} ± {:2f}\tAverage Total Profit: {:2f} ± {:2f}\t Average Ending BTC Price: {:2f} ± {:2f}\t'.format(
        results_df['Current BTC'].mean(), results_df['Current BTC'].std(), results_df['Total Profit'].mean(), results_df['Total Profit'].std(), results_df['Ending BTC Price'].mean(), results_df['Ending BTC Price'].std()))

But it prints:

Average BTC Left: 0.097777 ± 0.063326   Average Total Profit: 638354.458020 ± 342162.466084      Average Ending BTC Price: 19599.599660 ± 18235.782396

Why isn't it restricting the to 2 decimal places?

Shamoon
  • 41,293
  • 91
  • 306
  • 570

1 Answers1

1

I can't tell the new type of formating now, but old type is:

%.2f

print("%.2f" % 78.688411) --> 78.68
Raymond Reddington
  • 1,709
  • 1
  • 13
  • 21