C Sharp
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:
- Standard Numeric Format Strings - http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
time
Current time in miliseconds: [1]
long milliseconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;