Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Years since/doc: Difference between revisions

Template page
Created page with '{{TemplateBox |1=1 |1d=Year in between 0 and {{CURRENTYEAR}}. |1def= |1stat=required |2=mod |2d=Output can be rounded down to be multiple of parameter <nowiki>...'
 
No edit summary
Line 41: Line 41:
|relieson=
|relieson=
}}
}}
==Examples==
{| class="wikitable" border="1"
! Code !! Result
|-
| <code><nowiki>{{Years since|1950}}</nowiki></code> || {{Years since|1950}}
|-
| <code><nowiki>{{Years since|x|error=error}}</nowiki></code> || {{Years since|x|error=error}}
|-
| <code><nowiki>{{Years since| 1000 |min=60 |max=100 |mod=10}}</nowiki></code> || {{Years since| 1000 |min=60 |max=100 |mod=10}}
|-
| <code><nowiki>{{Years since| 1941 |min=60 |max=100 |mod=10}}</nowiki></code> || {{Years since| 1941 |min=60 |max=100 |mod=10}}
|-
| <code><nowiki>{{Years since| 1999 |min=60 |max=100 |mod=10}}</nowiki></code> || {{Years since| 1999 |min=60 |max=100 |mod=10}}
|-
| <code><nowiki>{{Years since| 1923 |min=60 |max=100 |mod=10}}</nowiki></code> || {{Years since| 1923 |min=60 |max=100 |mod=10}}
|-
|}


<includeonly>
<includeonly>
[[Category:Mathematical function templates]]
[[Category:Mathematical function templates]]
</includeonly>
</includeonly>

Revision as of 16:57, 8 February 2012

Function returning number of years since year {{{1}}}. The function is robust enough to survive various wrong inputs. Also user can control output to clip it to some range defined by {{{min}}} and {{{max}}} parameters. Also output can be rounded down to be multiple of parameter {{{mod}}}.

Usage

{{Years since |1= |mod= |min= |max= |error= }}

Template parameters

ParameterDescriptionDefaultStatus
1Year in between 0 and 2026.emptyrequired
modOutput can be rounded down to be multiple of parameter {{{mod}}}1optional
minminimum number possibly returned. Anything smaller will be set to {{{min}}}0optional
maxmaximum number possibly returned. Anything bigger will be set to {{{max}}}2026optional
errorvalue returned in case of not a number input parameter {{{1}}}.empty stringoptional

Additional information

The template is intended to be used in the following namespaces: unknown

The template is intended to be used by the following user groups: no user group specified

Examples

Code Result
{{Years since|1950}} 76
{{Years since|x|error=error}} error
{{Years since| 1000 |min=60 |max=100 |mod=10}} 100
{{Years since| 1941 |min=60 |max=100 |mod=10}} 80
{{Years since| 1999 |min=60 |max=100 |mod=10}} 60
{{Years since| 1923 |min=60 |max=100 |mod=10}} 100


Cookies help us deliver our services. By using our services, you agree to our use of cookies.