Difference between revisions of "Template:Add colon minutes"
Jump to navigation
Jump to search
blackwiki>Wikid77 (to speed performance 5x faster, skipped parameters 11-50 when parameter 11 is empty) |
blackwiki>Wikid77 (changed to skip other parameters, if parameter 19 is empty.) |
||
| Line 17: | Line 17: | ||
+ {{padleft:|{{#ifeq:{{substr|{{{9|0}}}|1|1}}|:|1|2}}|{{{9|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{9|0}}}|1|1}}|:|1|2}}|{{{9|0}}}}} | ||
+ {{padleft:|{{#ifeq:{{substr|{{{10|0}}}|1|1}}|:|1|2}}|{{{10|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{10|0}}}|1|1}}|:|1|2}}|{{{10|0}}}}} | ||
| − | |||
+ {{padleft:|{{#ifeq:{{substr|{{{11|0}}}|1|1}}|:|1|2}}|{{{11|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{11|0}}}|1|1}}|:|1|2}}|{{{11|0}}}}} | ||
+ {{padleft:|{{#ifeq:{{substr|{{{12|0}}}|1|1}}|:|1|2}}|{{{12|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{12|0}}}|1|1}}|:|1|2}}|{{{12|0}}}}} | ||
| Line 26: | Line 25: | ||
+ {{padleft:|{{#ifeq:{{substr|{{{17|0}}}|1|1}}|:|1|2}}|{{{17|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{17|0}}}|1|1}}|:|1|2}}|{{{17|0}}}}} | ||
+ {{padleft:|{{#ifeq:{{substr|{{{18|0}}}|1|1}}|:|1|2}}|{{{18|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{18|0}}}|1|1}}|:|1|2}}|{{{18|0}}}}} | ||
| + | {{#if:{{{19|}}}|<!--if param. 19 exists, then check 19-50--> | ||
+ {{padleft:|{{#ifeq:{{substr|{{{19|0}}}|1|1}}|:|1|2}}|{{{19|0}}}}} | + {{padleft:|{{#ifeq:{{substr|{{{19|0}}}|1|1}}|:|1|2}}|{{{19|0}}}}} | ||
+ {{padleft:|1|{{{20|0}}} }} <!-- | + {{padleft:|1|{{{20|0}}} }} <!-- | ||
| Line 58: | Line 58: | ||
--> + {{padleft:|1|{{{49|0}}} }} <!-- | --> + {{padleft:|1|{{{49|0}}} }} <!-- | ||
--> + {{padleft:|1|{{{50|0}}} }} <!-- | --> + {{padleft:|1|{{{50|0}}} }} <!-- | ||
| − | -->}}<!--endif {{{ | + | -->}}<!--endif {{{19|}}} exists-- |
--> ) + ( <!-- | --> ) + ( <!-- | ||
--------------------------------------- Plus carried minutes | --------------------------------------- Plus carried minutes | ||
| Line 71: | Line 71: | ||
--> + {{str_rightc |{{{9|0}}}|2 }}<!-- | --> + {{str_rightc |{{{9|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{10|0}}}|2 }}<!-- | --> + {{str_rightc |{{{10|0}}}|2 }}<!-- | ||
| − | |||
--> + {{str_rightc |{{{11|0}}}|2 }}<!-- | --> + {{str_rightc |{{{11|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{12|0}}}|2 }}<!-- | --> + {{str_rightc |{{{12|0}}}|2 }}<!-- | ||
| Line 80: | Line 79: | ||
--> + {{str_rightc |{{{17|0}}}|2 }}<!-- | --> + {{str_rightc |{{{17|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{18|0}}}|2 }}<!-- | --> + {{str_rightc |{{{18|0}}}|2 }}<!-- | ||
| + | -->{{#if:{{{19|}}}|<!--if param. 19 exists-- | ||
--> + {{str_rightc |{{{19|0}}}|2 }}<!-- | --> + {{str_rightc |{{{19|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{20|0}}}|2 }}<!-- | --> + {{str_rightc |{{{20|0}}}|2 }}<!-- | ||
| Line 112: | Line 112: | ||
--> + {{str_rightc |{{{49|0}}}|2 }}<!-- | --> + {{str_rightc |{{{49|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{50|0}}}|2 }}<!-- | --> + {{str_rightc |{{{50|0}}}|2 }}<!-- | ||
| − | -->}}<!--endif {{{ | + | -->}}<!--endif {{{19|}}} exists-- |
--> ) / 60 - 0.49) round 0 <!-- | --> ) / 60 - 0.49) round 0 <!-- | ||
-->}}<!--endexpr--><!-- | -->}}<!--endexpr--><!-- | ||
| Line 128: | Line 128: | ||
--> + {{str_rightc |{{{9|0}}}|2 }}<!-- | --> + {{str_rightc |{{{9|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{10|0}}}|2 }}<!-- | --> + {{str_rightc |{{{10|0}}}|2 }}<!-- | ||
| − | |||
--> + {{str_rightc |{{{11|0}}}|2 }}<!-- | --> + {{str_rightc |{{{11|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{12|0}}}|2 }}<!-- | --> + {{str_rightc |{{{12|0}}}|2 }}<!-- | ||
| Line 137: | Line 136: | ||
--> + {{str_rightc |{{{17|0}}}|2 }}<!-- | --> + {{str_rightc |{{{17|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{18|0}}}|2 }}<!-- | --> + {{str_rightc |{{{18|0}}}|2 }}<!-- | ||
| + | -->{{#if:{{{19|}}}|<!--if param. 19 exists-- | ||
--> + {{str_rightc |{{{19|0}}}|2 }}<!-- | --> + {{str_rightc |{{{19|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{20|0}}}|2 }}<!-- | --> + {{str_rightc |{{{20|0}}}|2 }}<!-- | ||
| Line 169: | Line 169: | ||
--> + {{str_rightc |{{{49|0}}}|2 }}<!-- | --> + {{str_rightc |{{{49|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{50|0}}}|2 }}<!-- | --> + {{str_rightc |{{{50|0}}}|2 }}<!-- | ||
| − | -->}}<!--endif {{{ | + | -->}}<!--endif {{{19|}}} exists-- |
--> ) - ( ( <!-- | --> ) - ( ( <!-- | ||
--------------------------------------- Minus full minutes | --------------------------------------- Minus full minutes | ||
| Line 182: | Line 182: | ||
--> + {{str_rightc |{{{9|0}}}|2 }}<!-- | --> + {{str_rightc |{{{9|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{10|0}}}|2 }}<!-- | --> + {{str_rightc |{{{10|0}}}|2 }}<!-- | ||
| − | |||
--> + {{str_rightc |{{{11|0}}}|2 }}<!-- | --> + {{str_rightc |{{{11|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{12|0}}}|2 }}<!-- | --> + {{str_rightc |{{{12|0}}}|2 }}<!-- | ||
| Line 191: | Line 190: | ||
--> + {{str_rightc |{{{17|0}}}|2 }}<!-- | --> + {{str_rightc |{{{17|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{18|0}}}|2 }}<!-- | --> + {{str_rightc |{{{18|0}}}|2 }}<!-- | ||
| + | -->{{#if:{{{19|}}}|<!--if param. 19 exists-- | ||
--> + {{str_rightc |{{{19|0}}}|2 }}<!-- | --> + {{str_rightc |{{{19|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{20|0}}}|2 }}<!-- | --> + {{str_rightc |{{{20|0}}}|2 }}<!-- | ||
| Line 223: | Line 223: | ||
--> + {{str_rightc |{{{49|0}}}|2 }}<!-- | --> + {{str_rightc |{{{49|0}}}|2 }}<!-- | ||
--> + {{str_rightc |{{{50|0}}}|2 }}<!-- | --> + {{str_rightc |{{{50|0}}}|2 }}<!-- | ||
| − | -->}}<!--endif {{{ | + | -->}}<!--endif {{{19|}}} exists-- |
--> ) / 60 - 0.49) round 0 ) * 60 round 0}}<!-- | --> ) / 60 - 0.49) round 0 ) * 60 round 0}}<!-- | ||
--> |2|0}}<!--set pad-length as 2 with digit 0 | --> |2|0}}<!--set pad-length as 2 with digit 0 | ||
Revision as of 05:25, 8 May 2010
Expression error: Unrecognized punctuation character ":".:Expression error: Unrecognized punctuation character "[".
|
The Template:Add_colon_minutes adds times of minutes/seconds (in format "mm:ss") and displays the total (as mmm:ss). A typical usage would be to add the times of music tracks for an album. Each time is specified as a parameter (up to 50 parameters). Usage:
The template cannot handle times with dots (".") due to checking the position of the colon, in the calculations. The total time is calculated using the MediaWiki parser function "padleft" and the highly complex substring template {{str_rightc}}.
|
| The above documentation is transcluded from Template:Add colon minutes/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |