跳转到内容

Template:Pop density

维基百科,自由的百科全书
文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

Usage

[编辑]

This template converts a population and area to a density.

{{Pop density|number of people|numerical value of area|unit of area|area unit to convert to}}

Examples

[编辑]
  • {{Pop density|120|240|km2|sqmi}} → "0.500/平方公里 (1.29/平方英里)"
  • {{Pop density|1600|600|sqmi|km2}} → "2.67/平方英里 (1.03/平方公里)"
rounding
  • {{Pop density|120|240|km2|sqmi|prec=1}} → "0.5/平方公里 (1.3/平方英里)"
no conversion
  • {{Pop density|120|240|km2}} → "0.500/平方公里"
reverse outputs
  • {{Pop density|1600|600|sqmi|km2|flip=on}} → "1.03/平方公里 (2.67/平方英里)"
give only raw numerical output
  • {{Pop density|120|240|km2|disp=num}} → "0.500"
  • {{Pop density|1600|600|sqmi|disp=num}} → "2.67"
  • {{Pop density|120|240|km2|sqmi|disp=num}} → "1.29"
  • {{Pop density|1600|600|sqmi|km2|disp=num}} → "1.03"
table
{| class="wikitable"
! Population !! Area (km<sup>2</sup>) !! Density (/km<sup>2</sup>)
|-
| {{pop density|120|2400|km2|disp=table}}
|}
Population Area (km2) Density (/km2)
120 2400 0.0500
{| class="wikitable"
! Population !! Area (km<sup>2</sup>) !! Density (/km<sup>2</sup>) !! Density (/sqmi)
|-
| {{pop density|120|2400|km2|sqmi|disp=table}}
|}
Population Area (km2) Density (/km2) Density (/sqmi)
120 2400 0.0500 0.129