How to convert dec to hex and binary

  • Thread starter Thread starter Soon Lee
  • Start date Start date
Hi Soon Lee,

If you by dec mean base 10 numbers, then you can use
Convert.ToString(number, base).

int n = 15;
string s1 = Convert.ToString(n, 2); // == 1111
string s2 = Convert.ToString(n, 16); // == f
 
Back
Top