Difference between revisions of "Template:Hex2dec/doc"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
imported>Mr. Stradivarius
(add {{lua}} template and remove Category:Lua-based templates, as it is added by the template as well - see Wikipedia talk:Lua#Lua talk template)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 +
{{lua|Module:BaseConvert}}
 +
 
=== Usage ===
 
=== Usage ===
 
*<tt><nowiki>{{hex2dec|0x0000}}</nowiki> → {{hex2dec|0x0000}}</tt>
 
*<tt><nowiki>{{hex2dec|0x0000}}</nowiki> → {{hex2dec|0x0000}}</tt>
Line 35: Line 37:
  
 
[[Category:Numerical conversion templates|{{PAGENAME}}]]
 
[[Category:Numerical conversion templates|{{PAGENAME}}]]
[[Category:Lua-based templates|{{PAGENAME}}]]
 
  
 
[[ro:Format:Hex2dec]]
 
[[ro:Format:Hex2dec]]
 
</includeonly>
 
</includeonly>

Revision as of 10:50, 19 July 2013

Usage

  • {{hex2dec|0x0000}} → 0
  • {{hex2dec|0xA0}} → 160
  • {{hex2dec|0x7C0}} → 1984
  • {{hex2dec|0xFFFF}} → 65535
  • {{hex2dec|0x845FED}} → 8675309
  • {{hex2dec|0x75BCD15}} → 123456789
  • {{hex2dec|0xDEADBEEF}} → 3735928559
  • {{hex2dec|0xFFFFFFFF}} → 4294967295
Input formats

Input with or without 0x prefix:

  • {{hex2dec|0xa0}} → 160
  • {{hex2dec|a0}} → 160

Uppercase and lowercase accepted:

  • {{hex2dec|A0}} → 160
  • {{hex2dec|a0}} → 160
Not a number input
  • {{hex2dec|}} → 0
  • {{hex2dec}} → 0
  • {{hex2dec|0xAXYZ}} → 0
  • {{hex2dec|XYZ}} → 0
  • {{hex2dec|0xA B}} → 0
  • {{hex2dec|A B}} → 0

See also