Template:Digit numeral system

From Meta, a Wikimedia project coordination wiki

Jump to: navigation, search


template:Digit ( talk edit history links )

This template gives the numeric value of the digit in a specified numeral system.

  • The first parameter gives the decimal value.
  • The second parameter is the digit (1 being the rightmost, 2 the one to the left etcetera).
  • The third parameter is the numeral system, 2 for binary, 8 for octal, 16 for hexadecimal.

For systems > 10, the value is given in decimals, for instance, 15 in the hexadecimal system will give for the rightmost digit 15 (which should be "F")

Usage:
{{Digit numeral system|decimal integer|digit no|numeral system number}}
All parameters must be positive integers.

[edit] Examples

  • {{Digit numeral system|13|3|2}} produces 1
  • {{Digit numeral system|15|1|16}} produces 15
  • {{Digit numeral system|373384|5|10}} produces 7