Template talk:Per capita

Category for invalid value
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
Would be good to add param value checking, in particular for the divisor (num) which currently just defaults to if no value is given, to prevent division by zero. Mathglot (talk) 20:33, 16 April 2023 (UTC)

Possible upgrade for precision
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 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) 8.148 and 202497 on the one hand, vs. B) 8148, 202497, and 6 on the other, should yield the same value, given a default precision of 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
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)