NHL Wiki
Advertisement

Template loop detected: Template:Documentation subpage

This template returns the number of full years between two specified dates. If the second set of parameters is not included, it will return the number of full years between a specified date and today's date.

Syntax:
{{age|year1|month1|day1|year2|month2|day2}} or
{{age|year1|month1|day1}}
Examples:
{{age|1989|7|23|2003|7|14}} returns "13"
{{age|1989|7|23}} returns "32"
When using this template to calculate a person's age at death or a person's age on a specified date (rather than the person's current age), please substitute it into the page.
Example: {{subst:age|1989|7|23|2003|7|14}}
Note:
This template does not check for incorrect input:
{{age|1980|7|14|1993|6|233}} returns "12" (surplus days do not count as extra months)
{{age|1980|7|14|1993|88|14}} returns "13" (surplus months do not count as extra years)

See also

  • {{age in years and days}} — Age in years and days
  • {{age in days}} — Age in days
  • {{birth date and age}} — Displays birth date and age
  • {{birth date and age2}} — Displays birth date and age as of a specified date
  • {{Age nts}} — Like this template, but will sort correctly in sortable tables.
  • Wikipedia:Age calculation templates

id:Templat:Umur ba:Ҡалып:Йәш bg:Шаблон:Age ca:Plantilla:Edat cs:Šablona:Věk da:Skabelon:Alder de:Vorlage:Alter dsb:Pśedłoga:Starstwo es:Plantilla:Edad eo:Ŝablono:Aĝo eu:Txantiloi:Adina fr:Modèle:Âge gl:Modelo:Idade ko:틀:나이 hsb:Předłoha:Staroba os:Шаблон:Кар it:Template:Età ja:Template:年数 no:Mal:Alder pt:Predefinição:Idade ro:Format:Age ru:Шаблон:Возраст sq:Stampa:Mosha simple:Template:Age sl:Predloga:Starost uk:Шаблон:Вік vi:Bản mẫu:Tuổi zh:Template:Age

This is an auxiliary template of Template:Rnd, called if the number, after rounding, is positive. Thus this description is about internal details only.

Its first parameter is the result of regular rounding with #expr and the function round (but if written in scientific format, as expression not always evaluating to the exact round number, see below), its second the rounding parameter, and its third the value of the condition that the rounding parameter is positive.

It calls one of the following templates, passing on the first and second parameter:

where the last digit is the value of the condition that the rounding parameter is positive, and the digit after the c depends on the range of the rounded number:

  • less than 1e-4: 2 (only possible if the rounding parameter is positive)
  • from 1e-4 to 1e5: 4
  • from 1e5 to 1e9: 6 if the number is a multiple of 1e5, otherwise 4
  • 1e9 or more: 8

Multiples of 1e5 between 1e5 and 1e9 are treated separately to avoid scientific notation.

Examples

  • {{rnd/b1|.0008|5|1}} → 0.00080
  • {{rnd/b1|1E+5|-5|0}} → 100000
  • {{rnd/b1|1.2E+6|-5|0}} → 1200000
  • {{rnd/b1|4.1E+6|10|1}} → 4100000.0000000000
  • {{rnd/b1|1540000000|-5|0}} → 1.5400×109
  • {{rnd/b1|1542689271|2|1}} → 1.54268927100×109

Notes

This template checks whether the exact 14-digit number that the input value represents (not to be confused with the float value to which it evaluates) is a multiple of 100,000. It does this by comparing the number with that rounded to a multiple of 100,000. The comparison is done after applying #expr to both sides. Experiments suggest that {{#expr:{{#expr:f}}}} gives the same string for all floats f for which {{#expr:f}} mathematically represents the same number, see m:Help:Format produced by expr#Categorizing floats by the mathematical value of the string produced by expr.


Advertisement