Difference between revisions of "Template:DEC/workpage"
Jump to navigation
Jump to search
imported>Frietjes |
|||
Line 16: | Line 16: | ||
</pre> | </pre> | ||
{{#explode:{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|.|1}} | {{#explode:{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|.|1}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
Line 81: | Line 76: | ||
{{#ifexpr: {{{A}}} < 0 | &minus; | + }}{{#if: {{#expr: (abs (trunc {{{A}}} )) < 10 }} | {{padleft:{{#expr: (abs (trunc {{{A}}} ))}}|2|0}} | {{#expr: (abs (trunc {{{A}}} ))}} }}"{{#if: {{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }} > 0 | {{str right|{{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }}|1}} }} | {{#ifexpr: {{{A}}} < 0 | &minus; | + }}{{#if: {{#expr: (abs (trunc {{{A}}} )) < 10 }} | {{padleft:{{#expr: (abs (trunc {{{A}}} ))}}|2|0}} | {{#expr: (abs (trunc {{{A}}} ))}} }}"{{#if: {{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }} > 0 | {{str right|{{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }}|1}} }} | ||
</pre> | </pre> | ||
− | {{#ifexpr: {{{A|}}} < 0 | − | + }}{{#if: {{#expr: (abs (trunc {{{A|}}} )) < 10 }} | {{padleft:{{#expr: (abs (trunc {{{A|}}} ))}}|2|0}} | {{#expr: (abs (trunc {{{A|}}} ))}} }}"{{#if: {{#expr: (abs {{{A|}}} ) - (abs (trunc {{{A|}}} )) }} > 0 | {{str right|{{#expr: (abs {{{A|}}} ) - (abs (trunc {{{A|}}} )) }}|1}} }} | + | {{#ifexpr: {{{A|0}}} < 0 | − | + }}{{#if: {{#expr: (abs (trunc {{{A|0}}} )) < 10 }} | {{padleft:{{#expr: (abs (trunc {{{A|0}}} ))}}|2|0}} | {{#expr: (abs (trunc {{{A|0}}} ))}} }}"{{#if: {{#expr: (abs {{{A|0}}} ) - (abs (trunc {{{A|0}}} )) }} > 0 | {{str right|{{#expr: (abs {{{A|0}}} ) - (abs (trunc {{{A|0}}} )) }}|1}} }} |
Revision as of 21:56, 25 July 2012
Template:NobotsTemplate:WorkpageTemplate:Purgebox
Try to extract fractional part
{{#expr: {{#expr: abs -13.26 }} mod {{#expr: abs {{#expr: trunc -13.26}} }} }}
0
{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}
0.26
{{#explode:{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|.|1}}
{{#explode:0.26|.|1}}
{{str right|{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|1}}
.26
{{#if: {{#expr: (abs -13.26) - (abs (trunc -13.26)) }} > 0 | {{str right|{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|1}} }}
.26
- check negative
{{#ifexpr: -13.26 < 0 | − | + }}
−
{{#ifexpr: +3.26 < 0 | − | + }}
+
{{#ifexpr: 0.26 < 0 | − | + }}
+
- pull together
{{#if: {{#expr: -13.26 < 0 }} | − }}{{#expr: abs (trunc -13.26)}}"{{#if: {{#expr: (abs -13.26) - (abs (trunc -13.26)) }} > 0 | {{str right|{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|1}} }}
−13".26
- complete
{{#ifexpr: -13.26 < 0 | − | + }}{{#if: {{#expr: (abs (trunc -13.26)) < 10 }} | {{padleft:{{#expr: (abs (trunc -13.26))}}|2|0}} | {{#expr: (abs (trunc -13.26))}} }}"{{#if: {{#expr: (abs -13.26) - (abs (trunc -13.26)) }} > 0 | {{str right|{{#expr: (abs -13.26) - (abs (trunc -13.26)) }}|1}} }}
−13".26
{{#ifexpr: -3.26 < 0 | − | + }}{{#if: {{#expr: (abs (trunc -3.26)) < 10 }} | {{padleft:{{#expr: (abs (trunc -3.26))}}|2|0}} | {{#expr: (abs (trunc -3.26))}} }}"{{#if: {{#expr: (abs -3.26) - (abs (trunc -3.26)) }} > 0 | {{str right|{{#expr: (abs -3.26) - (abs (trunc -3.26)) }}|1}} }}
−03".26
{{#ifexpr: 13.26 < 0 | − | + }}{{#if: {{#expr: (abs (trunc 13.26)) < 10 }} | {{padleft:{{#expr: (abs (trunc 13.26))}}|2|0}} | {{#expr: (abs (trunc 13.26))}} }}"{{#if: {{#expr: (abs 13.26) - (abs (trunc 13.26)) }} > 0 | {{str right|{{#expr: (abs 13.26) - (abs (trunc 13.26)) }}|1}} }}
+13".26
{{#ifexpr: +3.26 < 0 | − | + }}{{#if: {{#expr: (abs (trunc +3.26)) < 10 }} | {{padleft:{{#expr: (abs (trunc +3.26))}}|2|0}} | {{#expr: (abs (trunc +3.26))}} }}"{{#if: {{#expr: (abs +3.26) - (abs (trunc +3.26)) }} > 0 | {{str right|{{#expr: (abs +3.26) - (abs (trunc +3.26)) }}|1}} }}
+03".26
templatize
{{#ifexpr: {{{A}}} < 0 | − | + }}{{#if: {{#expr: (abs (trunc {{{A}}} )) < 10 }} | {{padleft:{{#expr: (abs (trunc {{{A}}} ))}}|2|0}} | {{#expr: (abs (trunc {{{A}}} ))}} }}"{{#if: {{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }} > 0 | {{str right|{{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }}|1}} }}
+00"
{{#if: {{{A|}}} | {{#ifexpr: {{{A}}} < 0 | − | + }}{{#if: {{#expr: (abs (trunc {{{A}}} )) < 10 }} | {{padleft:{{#expr: (abs (trunc {{{A}}} ))}}|2|0}} | {{#expr: (abs (trunc {{{A}}} ))}} }}"{{#if: {{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }} > 0 | {{str right|{{#expr: (abs {{{A}}} ) - (abs (trunc {{{A}}} )) }}|1}} }} | 00" }}
00"
- TEST
00"
Template talk:DEC/workpage
Template talk:DEC/workpage
Template talk:DEC/workpage
Template talk:DEC/workpage