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

From QBWiki
Jump to navigation Jump to search
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 39: Line 39:
 
</pre>
 
</pre>
 
|{{Hex to pseudo-decimal|ffffff}}
 
|{{Hex to pseudo-decimal|ffffff}}
 +
|-
 +
|<pre>
 +
{{Hex to pseudo-decimal|000000}}
 +
</pre>
 +
|{{Hex to pseudo-decimal|000000}}
 
|}
 
|}

Revision as of 20:53, 20 June 2022

Shortcut Template:Hex to dec.

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