Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two Decimal Places
#4
(Jan-09-2018, 09:52 PM)metulburr Wrote:
Quote:daily_payments = monthly_payments / 30
what about months with 31 days?

I'm only just beginning Python. I've no idea how to deal with that.

(Jan-09-2018, 09:46 PM)Windspar Wrote:
a = 123.456789
print "{0:.2f}".format(a)

old way
print "%.2f" % a


Thanks Windspar!
Reply


Messages In This Thread
Two Decimal Places - by Fumi - Jan-09-2018, 09:32 PM
RE: Two Decimal Places - by Windspar - Jan-09-2018, 09:46 PM
RE: Two Decimal Places - by metulburr - Jan-09-2018, 09:52 PM
RE: Two Decimal Places - by Fumi - Jan-10-2018, 07:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculate the Euler Number with more decimal places Pedroski55 10 4,626 Oct-31-2021, 04:45 AM
Last Post: Pedroski55
  Not rounding to desired decimal places? pprod 2 2,609 Mar-05-2021, 11:11 AM
Last Post: pprod
  Can I format decimal places by column with a dictionary? Mark17 2 2,605 Dec-28-2020, 10:13 PM
Last Post: Mark17
  testing for Decimal w/o importing decimal every time Skaperen 7 4,520 May-06-2019, 10:23 PM
Last Post: Skaperen
  Search "Places near by me" or "where am I" in google maps barry76 1 2,713 Feb-07-2019, 04:10 PM
Last Post: snippsat
  Error in Python 3.6 and how to limit decimal places Raptor88 6 9,944 Mar-18-2017, 05:02 AM
Last Post: Raptor88

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020