When converting from decimal to hexadecimal, add 0 if there are insufficient digits.

X: represents hexadecimal

4: Represents the number of data digits each time. When the number of digits is insufficient, 0 will be automatically added.


string number=1000.ToString("X4");
得出结果03E8

string number=0.ToString("X2");
得出结果00

string number=Convert.ToString(1000,16)
得出结果3E8

Guess you like

Origin blog.csdn.net/m0_73841296/article/details/131471364