Character.forDigit

Character.forDigit

Class Overview | Class Members | This Package | All Packages

Syntax
public static char forDigit( int digit, int radix )
Parameters
digit
the number to convert to a character.
radix
the radix.
Returns
the char representation of the specified digit in the specified radix.
Description
Determines the character representation for a specific digit in the specified radix. If the value of radix is not a valid radix, or the value of digit is not a valid digit in the specified radix, the null character ('\u0000') is returned.

The radix argument is valid if it is greater than or equal to MIN_RADIX and less than or equal to MAX_RADIX. The digit argument is valid if 0 <= digit <= radix.

If the digit is less than 10, then '0' + digit is returned. Otherwise, the value 'a' + digit - 10 is returned.

See Also
MIN_RADIX, MAX_RADIX, digit