Converts a decimal number to a hexadecimal number.
تعمل هذه الدالة في Google Sheets كما تعمل في Excel تمامًا — بالصياغة والوسائط نفسها.
DEC2HEX(number, [places])The DEC2HEX function takes a decimal integer and returns its hexadecimal equivalent. If the optional places argument is provided, the function pads the result with leading zeros to the specified length.
=DEC2HEX(10)النتيجة: A
Converts the decimal number 10 to its hexadecimal equivalent.
=DEC2HEX(10, 4)النتيجة: 000A
Converts 10 to hexadecimal and pads it to 4 characters.
DEC2HEX uses two's complement notation for negative numbers, returning a 10-character hexadecimal string.
This occurs if the number is outside the allowed range or if the 'places' argument is too small to represent the number.