Difference between revisions of "Template:Pseudo-decimal to hex"

From QBWiki
Jump to navigation Jump to search
(Created page with "<onlyinclude>{{#vardefine:i|0}}{{#while:<!-- -->|{{#vardefineecho:s|{{#explode:{{{1|0.0.0}}}|.|{{#var:i}}}}}}<!-- -->|{{#vardefine:first|{{#expr:floor({{#var:s}} / 16)}}}}<!--...")
 
Line 1: Line 1:
 
<onlyinclude>{{#vardefine:i|0}}{{#while:<!--
 
<onlyinclude>{{#vardefine:i|0}}{{#while:<!--
-->|{{#vardefineecho:s|{{#explode:{{{1|0.0.0}}}|.|{{#var:i}}}}}}<!--
+
-->|{{#vardefineecho:s|{{#explode:{{{1|0.0.0}}}|.|{{#var:i}}}}}}{{#var:s}}<!--
 
-->|{{#vardefine:first|{{#expr:floor({{#var:s}} / 16)}}}}<!--
 
-->|{{#vardefine:first|{{#expr:floor({{#var:s}} / 16)}}}}<!--
 
-->{{#vardefine:second|{{#expr:{{#var:s}} mod 16}}}}<!--
 
-->{{#vardefine:second|{{#expr:{{#var:s}} mod 16}}}}<!--
Line 6: Line 6:
 
-->{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#var:second}}|10|a}}|11|b}}|12|c}}|13|d}}|14|e}}|15|f}}<!--
 
-->{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#var:second}}|10|a}}|11|b}}|12|c}}|13|d}}|14|e}}|15|f}}<!--
 
-->{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}}}</onlyinclude>
 
-->{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}}}</onlyinclude>
 +
 
Shortcut [[Template:Dec to hex]].
 
Shortcut [[Template:Dec to hex]].
  

Revision as of 20:25, 20 June 2022

000000

Shortcut Template:Dec to hex.

Input Output
{{Pseudo-decimal to hex|0.0.0}}
000000
{{Pseudo-decimal to hex|255.255.255}}
ffffff
{{Pseudo-decimal to hex|127.12.80}}
7f0c50
{{Pseudo-decimal to hex|0.99.200}}
0063c8