Welcome to the DFO World Wiki. With many major updates since the release of DFO, many items are missing. Visit Item Database Project to learn more.
Please remember to click "show preview" before saving the page.
Thanks for the updated logo snafuPop!

Difference between revisions of "Template:Horizontal scale"

From DFO World Wiki
Jump to: navigation, search
m (add format to raw numbers)
m (Protected "Template:Horizontal scale": Don't change the algorithm ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>{{documentation}}</noinclude><includeonly>{{#ifeq:{{#expr:{{formatnum:{{{incrmnt}}}|R}}*0}}|0|{{#ifexpr:
+
<noinclude>{{documentation}}
  {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}
+
</noinclude><includeonly>{{#ifeq:{{#expr:{{{increment}}}*0}}|0|{{#ifexpr:
  <= {{{to}}} - {{{incrmnt}}}|<!-- Print all but last label in this fashion:
+
  {{Horizontal scale/Current Number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}
 +
  <= {{{to}}} - {{{increment}}}|<!-- Print all but last label in this fashion:
 
.if so, then--><div style="float:left; overflow:visible; width:{{#expr:  
 
.if so, then--><div style="float:left; overflow:visible; width:{{#expr:  
 
(
 
(
   <!--25*incrmnt / (Largest number to print - smallest number to print), giving room for 3 ticks in between-->
+
   <!--25*increment / (Largest number to print - smallest number to print), giving room for 3 ticks in between-->
  
   99.100 <!--IE can't handle 100-->  *  {{{incrmnt}}}
+
   99.100 <!--IE can't handle 100-->  *  {{{increment}}}
 
   /  
 
   /  
 
   (
 
   (
Line 14: Line 15:
 
   )
 
   )
 
)
 
)
}}%;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-1.8em; width:3.6em; overflow:visible; text-align:center">{{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}</div></div>|<!--
+
}}%;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-1.8em; width:3.6em; overflow:visible; text-align:center">{{Horizontal scale/Current Number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}</div></div>|<!--
 
.else-->{{#ifexpr:
 
.else-->{{#ifexpr:
  {{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}
+
  {{Horizontal scale/Current Number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}
 
  <= {{{to}}}|<!--
 
  <= {{{to}}}|<!--
.Last tick only --><div style="float:left; overflow:visible; width:0;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-2em; width:4em; text-align:center">{{Horizontal scale/Current number|from={{{from}}}|to={{{to}}}|incrmnt={{{incrmnt}}}|loop={{{loop}}} }}</div></div>}}
+
.Last tick only --><div style="float:left; overflow:visible; width:0;">{{!}}<div name=Number style="font-size:86%; position:relative; left:-2em; width:4em; text-align:center">{{Horizontal scale/Current Number|from={{{from}}}|to={{{to}}}|increment={{{increment}}}|loop={{{loop}}} }}</div></div>}}
}}|<br>Please delete the line <code>incrmnt=</code>. It's preventing the template from working.}}</includeonly>
+
}}|<br>Please delete the line <code>increment=</code>. It's preventing the template from working.}}</includeonly>

Latest revision as of 10:54, 15 August 2018

Template Documentation view

As used in {{Horizontal timeline}}.

Example

{{Horizontal scale
 |from=1
 |to=100
 |increment=1
 |loop=5
}}

produces

|
6