Template:DecHex

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:DecHex/doc.

Convert an integer from decimal to hexadecimal (without padding).

Usage

{{DecHex |1= }}

  • If the input is an empty string, the result is an empty string.
  • Non-integer and negative values are truncated to unsigned 64-bit integers (with a maximum of 16 hexadecimal digits returned).
  • The returned hexadecimal digits A to F are in upper case.
  • You can use {{padleft:{{DecHex|number}}|4|0}} if needed to pad the number with leading 0 to get a minimal length of 4 digits (for example to display Unicode computed code points with 4 to 6 hexadecimal digits, after the conventional "U+" prefix).

Template parameters

ParameterDescriptionDefaultStatus
1a decimal integeremptyoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified

Relies on:

See also

Localization

This template is not intended to be localized.