Template talk:Per capita
This is the talk page for discussing improvements to the Per capita template. |
|
![]() | Daily pageviews of Template:Per capita
A graph should have been displayed here but graphs are temporarily disabled. Until they are enabled again, visit the interactive graph at pageviews.wmcloud.org |
Category for invalid value
[edit]Might need to include a category for invalid year; see similar message at Template talk:To USD round. Mathglot (talk) 19:23, 16 April 2023 (UTC)
Add param checking
[edit]Would be good to add param value checking, in particular for the divisor (|num=
) which currently just defaults to 1
if no value is given, to prevent division by zero. Mathglot (talk) 20:33, 16 April 2023 (UTC)
Possible upgrade for precision
[edit]The conversion by {{To USD}} defaults to two decimal places, but when GDP for middling or smaller locales is given in unit billions with several decimal places (such as for Abbotsford, BC, at List of cities by GDP, where GDP is coded as 8.148
currently), using only two decimal places in currency conversion may not be ideal. That template has a precision param, |r=
, which may be used to set decimal places. Another alternative is to switch to {{To USD round}}, which instead of dealing with decimal places, has a param for dealing with significant figures, which may be a better way to go. Using that template, one can set |sf=
to determine the desired precision, and so for example, the param combos A) |num=8.148
and |pop=202497
on the one hand, vs. B) |num=8148
, |pop=202497
, and |scale=6
on the other, should yield the same value, given a default precision of |sf=4
in the template (configurable lower or higher, perhaps, by a |sf=
pass-through param). This should assure the same precision for all figures, regardless what the scale or population size is. Mathglot (talk) 08:23, 18 April 2023 (UTC)
Beijing
[edit]A problem was noted here, in connection with List of cities by GDP, regarding conversion for Beijing. Mathglot (talk) 22:25, 12 May 2023 (UTC)