toHexString property

String toHexString

Converts the number to a hexadecimal (base-16) string representation.

Similar to toBinaryString, this method first converts the number to an integer, then generates a hexadecimal string representation of that integer.

Returns: A string representing the hexadecimal representation of the number.

Example:

print(255.toHexString); // Outputs: ff

Implementation

String get toHexString => toInt().toRadixString(16);