Difference between revisions of "Template:Dp"

From Organic Design wiki
(set dp)
 
Line 3: Line 3:
 
:<tt><nowiki>{{#dp|2|1.234}}</nowiki></tt>
 
:<tt><nowiki>{{#dp|2|1.234}}</nowiki></tt>
 
Where the first parameter is the number of decimal places, and the second is the value to format.
 
Where the first parameter is the number of decimal places, and the second is the value to format.
}}
+
}}</noinclude>
 
{{#vardefine:tmp|{{#expr:{{{2}}}+0.{{#pad:5|{{{1}}}|0}}}}}}{{#sub:{{#var:tmp}}|0|{{#expr:{{#pos:{{#var:x}}|.}}+{{{1}}}+1}}}}
 
{{#vardefine:tmp|{{#expr:{{{2}}}+0.{{#pad:5|{{{1}}}|0}}}}}}{{#sub:{{#var:tmp}}|0|{{#expr:{{#pos:{{#var:x}}|.}}+{{{1}}}+1}}}}

Revision as of 11:26, 3 August 2007

File:Info.png This template sets a value to a specified number of decimal places, usage:
{{#dp|2|1.234}}

Where the first parameter is the number of decimal places, and the second is the value to format.

Expression error: Unrecognized punctuation character "{".