Toggle menu
14
236
69
27.2K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly>{{#switch:{{{2}}}
|  0 ={{#expr:  {{{1}}}    mod 10 }}
|  1 ={{#expr: ({{{1}}}/ 10) mod 10 }}
|  2 ={{#expr: ({{{1}}}/ 100) mod 10 }}
|  3 ={{#expr: ({{{1}}}/ 1000) mod 10 }}
|  4 ={{#expr: ({{{1}}}/ 10000) mod 10 }}
|  5 ={{#expr: ({{{1}}}/ 100000) mod 10 }}
|  6 ={{#expr: ({{{1}}}/ 1000000) mod 10 }}
|  7 ={{#expr: ({{{1}}}/ 10000000) mod 10 }}
|  8 ={{#expr: ({{{1}}}/ 100000000) mod 10 }}
|  9 ={{#expr: ({{{1}}}/ 1000000000) mod 10 }}
| 10 ={{#expr: ({{{1}}}/ 10000000000) mod 10 }}
| 11 ={{#expr: ({{{1}}}/ 100000000000) mod 10 }}
| 12 ={{#expr: ({{{1}}}/ 1000000000000) mod 10 }}
| #default= 0
}}</includeonly></onlyinclude>
{{documentation|content=
This template extracts one digit from an integer value of up to 12 digits.


== Usage  ==
<includeonly>{| class="DataBox" style="width: 100%; border: solid #553019 2px; font-size: 95%;"
| colspan="2" align="center"|This article has been updated for Kenshi version {{{version number}}}.
|}</includeonly><noinclude>
==Description==
This template is an easy and standardized way for editors to record the game version which they are updating the page to.


<code><nowiki>{{Cipher|{{{1}}}|{{{2}}}}}</nowiki></code>
==Syntax==
<pre>{{Version|version number}}</pre>
==Demonstration==
The following code...
<pre>{{Version|version number = 1.0.26}}</pre>
...produces this. [{{fullurl:{{ns:Template}}:{{PAGENAME}}}}?action=purge Refresh Preview]
{{Version|version number = 1.0.26}}


The first parameter is the integer value, the second is the position of the digit, from right to left (one, tenth, hundreds etc.).
[[Category:Templates]]</noinclude>
 
Having a value above the number of digits, a zero is returned.
 
== Examples ==
<code><nowiki>{{Cipher|987654321</nowiki>'''<nowiki>0</nowiki>'''<nowiki>|0}}</nowiki></code> results in {{Cipher|9876543210|0}}.
 
<code><nowiki>{{Cipher|</nowiki>'''<nowiki>9</nowiki>'''<nowiki>876543210|9}}</nowiki></code> results in {{Cipher|9876543210|9}}.
 
<code><nowiki>{{Cipher|12345678</nowiki>'''<nowiki>9</nowiki>'''<nowiki>|0}}</nowiki></code> results in {{Cipher|123456789|0}}.
 
<code><nowiki>{{Cipher|</nowiki>'''<nowiki>1</nowiki>'''<nowiki>23456789|8}}</nowiki></code> results in {{Cipher|123456789|8}}.
 
<code><nowiki>{{Cipher|43</nowiki>'''<nowiki>2</nowiki>'''<nowiki>109876543210|12}}</nowiki></code> results in {{Cipher|432109876543210|12}}.
 
<code><nowiki>{{Cipher|432109876543210|</nowiki>'''<nowiki>13</nowiki>'''<nowiki>}}</nowiki></code> results in {{Cipher|432109876543210|13}}!
 
== Note ==
 
This template is used by templates with mathematical terms and therefore appears to be integrated in very few pages.


[[Category:Legend templates]]
[[Category:Number templates]]
[[Category:Number templates]]
}}
[[Category:Legend templates]]
[[Category:Pages using the JsonConfig extension]]
[[Category:Pages using the JsonConfig extension]]
[[Category:Pages with TemplateStyles errors]]
[[Category:Pages with TemplateStyles errors]]
[[Category:Pages with syntax highlighting errors]]
[[Category:Software templates]]
[[Category:Software templates]]
[[Category:Table templates|Version]]
[[Category:Table templates|Version]]
[[Category:Template documentation pages|Version/doc]]
[[Category:Templates using TemplateData]]
[[Category:Templates using TemplateData]]
[[Category:Templates using TemplateStyles]]
[[Category:Templates using TemplateStyles]]

Latest revision as of 22:13, 21 May 2025


Description

This template is an easy and standardized way for editors to record the game version which they are updating the page to.

Syntax

{{Version|version number}}

Demonstration

The following code...

{{Version|version number = 1.0.26}}

...produces this. Refresh Preview

This article has been updated for Kenshi version 1.0.26.