ToString(“X”) produces single digit hex numbers

前端 未结 2 870
粉色の甜心
粉色の甜心 2020-12-31 01:05

We wrote a crude data scope.

(The freeware terminal programs we found were unable to keep up with Bluetooth speeds)

The results are okay, and we are writing

2条回答
  •  春和景丽
    2020-12-31 01:19

    "X" is a format specifier. It converts a number to a string of hexadecimal digits.

    int _abc = 123456;
    Console.WriteLine(_abc.ToString("X"));
    

    This will give you '1E240' as output

    ( 1E240 is the hexadecimal value of 123456 )

提交回复
热议问题