Actions

Template

Difference between revisions of "Pagecount"

From Sonic Retro

(Created page with "<includeonly>{{#vardefine:pagecountresult|0}} {{#loop: chunknum |0 |{{#expr:{{charcount|{{{1}}}|,}}+1}} |{{#vardefine:chunk|{{#explode:{{{1}}}|,|{{#var:chunknum}}}}}} {{addva...")
 
 
Line 12: Line 12:
 
Example: <nowiki>{{pagecount|12-14,17,20-21}}</nowiki> becomes {{pagecount|12-14,17,20-21}}.
 
Example: <nowiki>{{pagecount|12-14,17,20-21}}</nowiki> becomes {{pagecount|12-14,17,20-21}}.
  
[[Category:Sonic Retro templates]]</noinclude>
+
[[Category:Templates]]</noinclude>

Latest revision as of 19:18, 1 January 2022

Calculate the size of a range (inclusive) given by the format "a-b". It also works with broken ranges in the format "a-b,c-d".

Example: {{pagecount|12-14}} becomes 3.

Example: {{pagecount|12-14,17,20-21}} becomes 6.