Template talk:Day Job Duration

From Homecoming Wiki
Revision as of 14:42, 19 February 2009 by imported>Sekoia (historical) (New page: == Calculations == Is duration always going to be in minutes? If so, could we move "minutes" into the template so that the three values are always numerical? If that's safe to do, then I c...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Calculations

Is duration always going to be in minutes? If so, could we move "minutes" into the template so that the three values are always numerical? If that's safe to do, then I can add a bit to the template that would calculate the time to max when all three values are present.

{{#iferror: The maximum will be reached after {{#expr: {{{hours}}} * ({{{max}}} * 60)/{{{duration}}} / 24 }} days. }}

If hours=24|duration=12|max=2, then it spits out:

The maximum will be reached after 10 days.

The equivalent for charges:

{{#iferror: The maximum will be reached after {{#expr: {{{hours}}} * {{{max}}} * 60 / {{{charges}}} / 24 }} days. }}

I noticed the "time to max" was on some of the pages, this could be an easy way to continue including it. (The "iferror" tag means that if the three values aren't numbers, nothing gets output; so the whole thing only shows if all three values are present and numerical.) -- Sekoia 14:42, 19 February 2009 (UTC)