Display value using the standard format specifiers for ulong value

image_pdfimage_print
   
 

using System;

public class Example
{
   public static void Main()
   {
      ulong value = 163249057;
      // Display value using default ToString method.
      Console.WriteLine(value.ToString());      
      Console.WriteLine();

      // Define an array of format specifiers.
      string[] formats = { "G", "C", "D", "F", "N", "X" };
      // Display value using the standard format specifiers.
      foreach (string format in formats)
         Console.WriteLine("{0} format specifier: {1,16}",format, value.ToString(format));         
   }
}

   
     


This entry was posted in Data Types. Bookmark the permalink.