Difference between revisions of "Template:Hex to pseudo-decimal"

From QBWiki
Jump to navigation Jump to search
(Created page with "<onlyinclude>{{#vardefine:i|0}}{{#vardefine:preslice|{{#while:<!-- -->|{{#vardefineecho:s|{{#sub:{{{1|}}}|{{#var:i}}|1}}}}<!-- -->|{{#ifeq:{{#var:s}}|a|10<!-- --><!---->|{{#if...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<onlyinclude>{{#vardefine:i|0}}{{#vardefine:preslice|{{#while:<!--
 
<onlyinclude>{{#vardefine:i|0}}{{#vardefine:preslice|{{#while:<!--
-->|{{#vardefineecho:s|{{#sub:{{{1|}}}|{{#var:i}}|1}}}}<!--
+
-->|{{#vardefineecho:s|{{#sub:{{{1|}}}|{{#var:i}}|1}}}}{{#var:s}}<!--
 
-->|{{#ifeq:{{#var:s}}|a|10<!--
 
-->|{{#ifeq:{{#var:s}}|a|10<!--
 
--><!---->|{{#ifeq:{{#var:s}}|b|11<!--
 
--><!---->|{{#ifeq:{{#var:s}}|b|11<!--
Line 14: Line 14:
 
-->{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 
-->{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 
}}}}{{#sub:{{#var:preslice}}|0|{{#expr:{{#len:{{#var:preslice}}}}-1}}}}</onlyinclude>
 
}}}}{{#sub:{{#var:preslice}}|0|{{#expr:{{#len:{{#var:preslice}}}}-1}}}}</onlyinclude>
 +
Shortcut [[Template:Hex to dec]].
 +
Inverse [[Template:Pseudo-decimal to hex]].
 +
 
{| class="wikitable"
 
{| class="wikitable"
 
! Input
 
! Input
Line 37: Line 40:
 
</pre>
 
</pre>
 
|{{Hex to pseudo-decimal|ffffff}}
 
|{{Hex to pseudo-decimal|ffffff}}
 +
|-
 +
|<pre>
 +
{{Hex to pseudo-decimal|000000}}
 +
</pre>
 +
|{{Hex to pseudo-decimal|000000}}
 
|}
 
|}

Latest revision as of 16:46, 21 June 2022

Shortcut Template:Hex to dec. Inverse Template:Pseudo-decimal to hex.

Input Output
{{Hex to pseudo-decimal|1345}}
1.3.4.5
{{Hex to pseudo-decimal|13e5}}
1.3.14.5
{{Hex to pseudo-decimal|dffg}}
13.15.15.g
{{Hex to pseudo-decimal|ffffff}}
15.15.15.15.15.15
{{Hex to pseudo-decimal|000000}}
0.0.0.0.0.0