Python Forum
Percentages displayed as "0.00"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Percentages displayed as "0.00"
#2
If I had this I would first try to see directly from the database what the result is.
In this case it would be sufficient to remove the formatting. Just show what comes from the database.
And then: to get a percentage you need to multiply the ratio by 100. So instead of:
1.0 * NUMBER / (SELECT SUM(NUMBER) FROM MyTable)
... you should do:
100.0 * NUMBER / (SELECT SUM(NUMBER) FROM MyTable)
Reply


Messages In This Thread
Percentages displayed as "0.00" - by Winfried - Nov-15-2019, 03:27 PM
RE: Percentages displayed as "0.00" - by ibreeden - Nov-15-2019, 04:29 PM
RE: Percentages displayed as "0.00" - by Winfried - Nov-15-2019, 05:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fuzzy Wuzzy how to get my fuzzyratio displayed windingsareuseful 3 460 Apr-04-2024, 05:38 PM
Last Post: deanhystad
  Trying to get counts/sum/percentages from pandas similar to pivot table cubangt 6 1,699 Oct-06-2023, 04:32 PM
Last Post: cubangt
  Table displayed out of order nigelwright7557 3 1,919 Nov-24-2021, 10:07 AM
Last Post: nigelwright7557
  Unexpected output: symbols for derivative not being displayed saucerdesigner 0 2,150 Jun-22-2020, 10:06 PM
Last Post: saucerdesigner
  Auto-copy all displayed "print" results into clipboard? smallabc 1 1,762 Dec-16-2019, 02:10 PM
Last Post: buran

Forum Jump:

User Panel Messages

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