Template:DEC/workpage

From blackwiki
< Template:DEC
Revision as of 04:19, 3 April 2018 by imported>JJMC89 (Remove {{bots}} being used as a blunt instrument contrary to the documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template: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  | &minus; | + }}

{{#ifexpr: +3.26 < 0  | &minus; | + }}

+

{{#ifexpr: 0.26 < 0  | &minus; | + }}

+

pull together
{{#if: {{#expr: -13.26 < 0 }} | &minus; }}{{#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 | &minus; | + }}{{#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 | &minus; | + }}{{#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 | &minus; | + }}{{#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 | &minus; | + }}{{#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 | &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}} }}

+00"


{{#if: {{{A|}}} |
{{#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}} }}
| 00" }}

00"

TEST

00"


00"


−13".26


+03".26


+00".26