Skip to content

Instantly share code, notes, and snippets.

@loctanvo
Created November 8, 2015 23:05
Show Gist options
  • Save loctanvo/a7dac5098d788e150e2c to your computer and use it in GitHub Desktop.
Save loctanvo/a7dac5098d788e150e2c to your computer and use it in GitHub Desktop.
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