Diferencia entre revisiones de «Plantilla:Decimal to hexadecimal converter»

De WikiMinecraft
Saltar a: navegación, buscar
(Página creada con «<!-- if one -->{{#ifeq:<!-- if -->{{#expr:255<{{{1|256}}}}}|0|<!-- then 2 digit code -->{{Decimal to hexadecimal converter/Switch|<!-- ---->{{#expr:<!-- -----...»)
 
 
(No se muestran 5 ediciones intermedias de 3 usuarios)
Línea 1: Línea 1:
<!--
+
<includeonly>{{#invoke: Convert base | fromDec | {{{1}}} | 16 }}</includeonly><noinclude>
 
+
{{/doc}}
if one
+
[[Category:Templates|D]]
 
+
</noinclude>
-->{{#ifeq:<!--
 
 
 
 
 
if
 
 
 
 
 
-->{{#expr:255<{{{1|256}}}}}|0|<!--
 
 
 
 
 
then
 
 
 
2 digit code
 
 
 
 
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor({{{1|16777215}}}/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{{1|16777215}}} mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
 
 
else --->|{{#ifeq:<!--
 
 
 
if
 
 
 
 
 
 
 
-->{{#expr:4095<{{{1|4096}}}}}|0|<!--
 
 
 
 
 
 
 
then
 
 
 
3 digit code
 
 
 
 
 
 
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor(floor({{{1|16777215}}}/16)/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor({{{1|16777215}}}/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{{1|16777215}}} mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
 
 
 
 
else --->|<!--
 
 
 
6 digit code
 
 
 
 
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor(floor(floor(floor(floor({{{1|16777215}}}/16)/16)/16)/16)/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor(floor(floor(floor({{{1|16777215}}}/16)/16)/16)/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor(floor(floor({{{1|16777215}}}/16)/16)/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor(floor({{{1|16777215}}}/16)/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{#expr:<!--
 
 
 
-------->floor({{{1|16777215}}}/16)<!--
 
 
 
------>}}<!--
 
 
 
------> mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
-->{{Decimal to hexadecimal converter/Switch|<!--
 
 
 
---->{{#expr:<!--
 
 
 
------>{{{1|16777215}}} mod 16<!--
 
 
 
---->}}<!--
 
 
 
-->}}<!--
 
 
 
 
 
end ifs
 
 
 
-->}} }}<!--
 
 
 
 
 
--><noinclude>
 
 
 
== Documentation ==
 
 
 
This is a simple to use tool for dynamically converting decimal values to hexadecimal values. It outputs in a 6 character hex format and so can take decimal numbers up to 16777215. The currently system implemented for truncating preceding 0's allows for outputs in 2, 3, and 6 character hex format based on the imput.
 
 
 
=== Code ===
 
 
 
In full the template code is as follows:
 
 
 
<pre>
 
 
 
{{Decimal to hexadecimal converter|1234}}
 
 
 
</pre>
 
 
 
But it is much easier to use it through the redirect dec-hex which allows it to be written out as:
 
 
 
<pre>{{Dec-hex|1234}}
 
 
 
</pre>
 
 
 
Both of which will output 4D2.
 
[[Category:Plantillas]]
 

Revisión actual del 23:03 10 oct 2014

Template-info.png Documentación
Atajo
dec-hex
Lua logo.png
Esta plantilla usa Módulo:Convert base, un script escrito en el lenguaje de programación Lua. Por favor lea mw:Lua y mw:Extension:Scribunto para saber más del lenguaje Lua.

This is a simple to use tool for dynamically converting decimal values to hexadecimal values. It outputs in a 6 character hex format and so can take decimal numbers up to 9999999999999999999.

Code

In full the template code is as follows:

{{Decimal to hexadecimal converter|1234}}

But it is much easier to use it through the redirect dec-hex which allows it to be written out as:

{{Dec-hex|1234}}

Both of which will output 4D2.

See also

La documentación anterior se transcluye de Plantilla:Decimal to hexadecimal converter/doc. (edit | history)