Template talk:Wins-losses-pct in table

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by AlanM1 (talk | contribs) at 17:47, 31 December 2023 (→‎Overlap in functionality: New ties parm, calc template). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Overlap in functionality

There is overlap in functionality with {{Winning percentage}}. I see the advantage to this template in that it automatically generates table markup, but the mathematical computations are incorrect (0 wins and 0 losses isn't .000, it's NaN). This template should use the {{Winning percentage}} to calculate the winning percentage so that the logic isn't duplicated between the two. Also, IMO, this template should be renamed to something like {{Win-loss-pct in table}} with redirects ({{winpcttable}} for example) to shorten what needs to be typed. — X96lee15 (talk) 14:12, 5 December 2014 (UTC)[reply]

So I addressed the divide by zero if there are 0 total games. Shouldn't be too tough to make this use the {{Winning percentage}} template. — X96lee15 (talk) 19:31, 12 November 2015 (UTC)[reply]
@Dmoore5556, X96lee15, and McVahl: I've now added an optional third parameter for ties. If present, it produces an additional column for the value after losses, and adds half it's value to the percentage. I also took out the calculation code and transcluded {{Winning percentage}} instead. I updated the doc and added test cases for the new parm. I'm kind of rusty at this, so I hope it's OK; let me know if there are any problems. —[AlanM1 (talk)]— 17:47, 31 December 2023 (UTC)[reply]