Difference between revisions of "Template:Ds"

From ChoralWiki
Jump to navigation Jump to search
({{ds|n}} creates n digit-width spaces for n=0,1,...,12. {{ds}} is the same as {{ds|1}})
 
(add documentation)
Line 1: Line 1:
 
{{#switch: {{{1|1}}}
 
{{#switch: {{{1|1}}}
|0=|1=<span style="margin-left:0.583em"></span>|2=<span style="margin-left:1.167em"></span>|3=<span style="margin-left:1.75em"></span>|4=<span style="margin-left:2.333em"></span>|5=<span style="margin-left:2.917em"></span>|6=<span style="margin-left:3.5em"></span>|7=<span style="margin-left:4.083em"></span>|8=<span style="margin-left:4.667em"></span>|9=<span style="margin-left:5.25em"></span>|10=<span style="margin-left:5.833em"></span>|11=<span style="margin-left:6.417em"></span>|12=<span style="margin-left:7em"></span>|<span style="margin-left:0.583em"></span>}}
+
|0=|1=<span style="margin-left:0.583em"></span>|2=<span style="margin-left:1.167em"></span>|3=<span style="margin-left:1.75em"></span>|4=<span style="margin-left:2.333em"></span>|5=<span style="margin-left:2.917em"></span>|6=<span style="margin-left:3.5em"></span>|7=<span style="margin-left:4.083em"></span>|8=<span style="margin-left:4.667em"></span>|9=<span style="margin-left:5.25em"></span>|10=<span style="margin-left:5.833em"></span>|11=<span style="margin-left:6.417em"></span>|12=<span style="margin-left:7em"></span>|<span style="margin-left:0.583em"></span>}}<noinclude>
 +
{{prot-temp}}
 +
[[Category:Templates]]
 +
{{DisplayBox|text=
 +
;Documentation
 +
<pre>{{ds|n}}</pre>
 +
produces a horizontal width equal to that of ''n'' digits, for n = 0,1,...,12.
 +
<pre>{{ds}}</pre>
 +
is equivalent to <tt><nowiki>{{ds|1}}</nowiki></tt> and produces a single digit space.
 +
Here are some examples:
 +
:{{ds|3}}1 - type: <tt><nowiki>{{ds|3}}1</nowiki></tt>
 +
:{{ds|2}}10 - type: <tt><nowiki>{{ds|2}}10</nowiki></tt>
 +
:{{ds|1}}100 - type: <tt><nowiki>{{ds|1}}100</nowiki></tt> or just <tt><nowiki>{{ds}}100</nowiki></tt>
 +
:{{ds|0}}1000 - type: <tt><nowiki>{{ds|0}}1000</nowiki></tt> or just <tt>1000</tt>
 +
}}
 +
</noinclude>

Revision as of 14:48, 29 August 2009

Documentation
{{ds|n}}

produces a horizontal width equal to that of n digits, for n = 0,1,...,12.

{{ds}}

is equivalent to {{ds|1}} and produces a single digit space. Here are some examples:

1 - type: {{ds|3}}1
10 - type: {{ds|2}}10
100 - type: {{ds|1}}100 or just {{ds}}100
1000 - type: {{ds|0}}1000 or just 1000