Template:Add colon minutes/sandbox

From blackwiki
Jump to navigation Jump to search

0:00

Template documentation[view] [edit] [history] [purge]

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:

{{add colon minutes|1:01|2:02|3:03}}     → 6:06
{{add colon minutes|3:30|2:40|20:07}}    → 26:17

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}}.

See also