Created
November 8, 2015 23:05
-
-
Save loctanvo/a7dac5098d788e150e2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Default Math.Round(x)"); | |
Console.WriteLine(Round(1.5)); | |
Console.WriteLine(Round(2.5)); | |
Console.WriteLine(Round(3.5)); | |
} | |
private static string Round(double value) | |
{ | |
var result = Math.Round(value); | |
return string.Format(CultureInfo.InvariantCulture, "Math.Round({0}) --> {1}", value, result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment