Difference between revisions of "Template:Add dot minutes/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>GregorB
({{documentation subpage}})
blackwiki>Vanisaac
m (→‎top: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
Line 12: Line 12:
 
|}
 
|}
  
<includeonly>
+
<includeonly>{{Sandbox other||
 
[[Category:Mathematical time and date function templates]]
 
[[Category:Mathematical time and date function templates]]
</includeonly>
+
}}</includeonly>

Revision as of 21:52, 23 April 2020

The Template:Add dot 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:

{{add dot minutes|1.01|2.02|3.03}}     → 6.06
{{add dot minutes|1.11|2.22|3.33}}     → 7.06
{{add dot minutes|11.11|22.22|33.33|44.44}}     → 111.50

The template cannot handle times with colons (":") due to error "Unrecognized character" in the calculations. The total time is calculated very quickly, using the built-in MediaWiki operator "round" and parser function "padleft".