Ushort To Byte convert : ushort « Data Type « C# / CSharp Tutorial






using System;

class MainClass
{
   static void Main()
   {
      ushort sh = 10;
      byte sb = (byte)sh;
      Console.WriteLine("sb:  {0} = 0x{0:X}", sb);

      sh = 1365;
      sb = (byte)sh;
      Console.WriteLine("sb:  {0} = 0x{0:X}", sb);
   }
}
sb:  10 = 0xA
sb:  85 = 0x55








2.17.ushort
2.17.1.ushort value
2.17.2.Ushort To Byte convert
2.17.3.Use ushort as the parameter for overload methods
2.17.4.Format ushort with: "G", "C", "D3", "E2", "e3", "F", "N", "P", "X", "000000.0", "#.0"