Module:Duration/doc
This is the documentation page for Module:Duration
The module is meant for language-dependant time calculations.
This module transform arguments in the form ssss (any number of digits) in anglosaxon format (with a point before the thousand digits orwithout separators), to a "text expresion": millennia, centuries, years, days, hours, minutes, seconds, tenths, hundredths and thousandths.
Optional parameter format=hms
show a reduced version of time units.
Examples
edit- {{#invoke:Duration | sec2expr |7210}} returns: 2 hores and 10 segons
- {{#invoke:Duration | sec2expr |6510.8}} returns: 1 hora, 48 minuts, 30 segons and 8 dècimes
- {{#invoke:Duration | sec2expr |3580}} -> 59 minuts and 40 segons
- {{#invoke:Duration | sec2expr |120.32 }} -> 2 minuts, 3 dècimes and 2 centèsimes
- {{#invoke:Duration | sec2expr |50 }} -> 50 segons
- {{#invoke:Duration | sec2expr |14.5 }} -> 14 segons and 5 dècimes
Amb format=hms
- {{#invoke:Duration | sec2expr |6510.8 |format=hms}} returns: 1h 48′ 30.8″
- {{#invoke:Duration | sec2expr |3580 |format=hms}} -> 59′ 40″
- {{#invoke:Duration | sec2expr |14.5 |format=hms }} -> 14.5″
- NOTE
- to manage european notation figures (decimal comma and points),
{{EUsec2expr}}
must be used previously to invoke this module. Ex.:
- {{EUsec2expr|7000}} returns Template:EUsec2expr.