Actions

Template

Difference between revisions of "Get simple version number"

From WikiApiary, monitoring the MediaWiki universe

(Created page with "<noinclude> This template accepts a version string that may contain additional information about packages and distributions, like <code>5.3.10-1ubuntu3.4</code> and returns ju...")
 
 
Line 10: Line 10:
 
{{Get simple version number|5.3.10-1ubuntu3.4}}
 
{{Get simple version number|5.3.10-1ubuntu3.4}}
  
 +
There are some [[/Tests|tests]] that can be used to make sure this template is working right.
 
</noinclude>
 
</noinclude>
 
<includeonly>{{ <!-- test for the presence of a - in the input, if no dash simply return the same thing that was passed in -->
 
<includeonly>{{ <!-- test for the presence of a - in the input, if no dash simply return the same thing that was passed in -->

Latest revision as of 16:25, 31 December 2012

This template accepts a version string that may contain additional information about packages and distributions, like 5.3.10-1ubuntu3.4 and returns just the version information to the left of the -, providing a simplified version number for better aggregation.

{{Get simple version number|5.3.10-1ubuntu3.4}}

The above example returns:


5.3.10

There are some tests that can be used to make sure this template is working right.