• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Infobox settlement/checkauto

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
< Template:Infobox settlement
Template documentation[view] [edit] [history] [purge]
This subtemplate is not intended to be used directly

This subtemplate of {{Infobox settlement}} checks the inputs that will be passed to {{Infobox settlement/densdisp}} if there is a density to be displayed. This template outputs the density either as provided or as calculated (if set to auto). The automatic calculation requires both the population and area; if either is not provided then this template generates no output.

Contents

  • 1 Usage
  • 2 Examples with density auto
  • 3 Examples with density number
  • 4 See also

Usage

{{Infobox settlement/checkauto
| /km2  = auto or population density per km2 (via population_density_km2 and others)
| /sqmi = auto or population density per sqmi (via population_density_sq_mi and others)
| pop   = population (via population_total and others)
| km2   = area in square kilometres (via area_total_km2 and others)
| sqmi  = area in square miles (via area_total_sq_mi and others)
| ha    = area in hectares (via area_total_ha and others)
| acre  = area in acres (via area_total_acre and others)
| dunam = area in dunams (via area_total_dunam and others)
}}

Examples with density auto

As shown in the following examples, this template calculates the density if all three of the following conditions are met: /km2 (or /sqmi) is set to auto, a number if given for population, and a number is given for area. It also strips any formatting from the numbers, such as population with commas in the examples, which would otherwise cause an error in the calculation (see mw:Help:Magic words#Formatting).

Code Result
{{Infobox settlement/checkauto|/km2=auto|pop=123,456|km2=10}} 12345.6
{{Infobox settlement/checkauto|/km2=auto|pop= |km2=10}}
{{Infobox settlement/checkauto|/km2=auto|pop=123,456|km2= }}
{{Infobox settlement/checkauto|/km2=auto|pop= |km2= }}
{{Infobox settlement/checkauto|/km2= |pop= |km2= }}

Examples with density number

As shown in the following examples, this template always displays the density if given as a number, regardless of whether the population and area are defined. It also strips any formatting in the number, such as the commas in the examples.

Code Result
{{Infobox settlement/checkauto|/km2=12,345.6|pop=123,456|km2=10}} 12345.6
{{Infobox settlement/checkauto|/km2=12,345.6|pop= |km2=10}} 12345.6
{{Infobox settlement/checkauto|/km2=12,345.6|pop=123,456|km2= }} 12345.6
{{Infobox settlement/checkauto|/km2=12,345.6|pop= |km2= }} 12345.6

See also

  • {{Infobox settlement}}
  • {{Infobox settlement/areadisp}}
  • {{Infobox settlement/densdisp}}
  • {{Infobox settlement/lengthdisp}}
  • {{Infobox settlement/pref}}
  • {{Infobox settlement/metric}}
  • {{Infobox settlement/metric/mag}}
  • {{Infobox settlement/impus}}
  • {{Infobox settlement/impus/mag}}
  • {{Infobox settlement/dunam}}
  • {{Infobox settlement/dunam/mag}}
  • {{Infobox settlement/link}}
  • {{Infobox settlement cleaner}}

bn:টেমপ্লেট:Infobox settlement/checkauto sl:Predloga:Infopolje Naselje/checkauto

The above documentation is transcluded from Template:Infobox settlement/checkauto/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Infobox_settlement/checkauto&oldid=20349"
Category:
  • Place infobox subtemplates
Last edited on 19 October 2013, at 06:29

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 19 October 2013, at 06:29.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop