C Sharp

From Omnia
Revision as of 05:22, 27 December 2022 by Kenneth (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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