C Sharp

From Omnia
Jump to navigation Jump to search

Main

Comments

// This is a comment

/* This is a
multi-line comment */

float

double d = 1.245;
Console.WriteLine(d.ToString("0.##")); 

float pi = 3.1415;
Console.WriteLine(pi.ToString("0.##"));  # show two decimals
Console.WriteLine(pi.ToString("F0"));  # show no decimals

References:

time

Current time in miliseconds: [1]

long milliseconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

keywords