Python Forum
Python random formatting issues
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python random formatting issues
#9
(Jan-28-2018, 09:03 PM)Barnettch3 Wrote: It just seems like a bug and was wondering if anyone else had experience with something like this.

If there is a bug, it is in your code, it is not in the python interpreter. The round function does exactly what the documentation says.

If you are experimenting errors with formatting, then you need the format method. For example the line
print(F*100, "%")
is better written
print('{:.2f} %'.format(F*100))
Can you describe the issue more precisely or give a code that we can run to see the pathological behavior?
Reply


Messages In This Thread
Python random formatting issues - by Barnettch3 - Jan-24-2018, 06:05 PM
RE: Python random formatting issues - by Larz60+ - Jan-24-2018, 06:35 PM
RE: Python random formatting issues - by j.crater - Jan-24-2018, 06:54 PM
RE: Python random formatting issues - by j.crater - Jan-24-2018, 07:02 PM
RE: Python random formatting issues - by snippsat - Jan-24-2018, 09:33 PM
RE: Python random formatting issues - by Barnettch3 - Jan-28-2018, 09:03 PM
RE: Python random formatting issues - by Gribouillis - Jan-28-2018, 09:23 PM
RE: Python random formatting issues - by Barnettch3 - Jan-28-2018, 10:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  String formatting (strptime) issues Henrio 2 884 Jan-06-2023, 06:57 PM
Last Post: deanhystad
  python-docx: preserve formatting when printing lines Tmagpy 4 2,171 Jul-09-2022, 01:15 AM
Last Post: Tmagpy
Shocked Issues Installing Pyenv/Python 3.9.1 Brandon_Contactum 1 2,581 Feb-22-2022, 06:32 PM
Last Post: snippsat
  OpenPyXl formatting issues kpayney1 0 1,725 Nov-26-2021, 01:56 AM
Last Post: kpayney1
  Formatting issues? Mark17 1 1,724 Dec-30-2020, 04:17 PM
Last Post: Mark17
  Changing to new Python formatting example leodavinci1990 3 2,070 Sep-22-2020, 07:36 PM
Last Post: yaythomas
  TurtleWorld on MAC in Python 3.6 issues benniehanas 3 3,754 Jul-09-2018, 08:00 PM
Last Post: ichabod801
  Issues with Python script as service satishgunjal 8 7,577 Jun-21-2018, 11:40 AM
Last Post: satishgunjal
  python variable issues - using spyder and opencv Afrodizzyjack 5 5,857 Jun-19-2018, 09:46 AM
Last Post: gontajones
  issues while using Psexec from python code dev_devil_1983 0 3,579 May-28-2018, 07:55 AM
Last Post: dev_devil_1983

Forum Jump:

User Panel Messages

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