Skip to content

Instantly share code, notes, and snippets.

@geoffreymcgill
Created August 12, 2017 21:35
Show Gist options
  • Save geoffreymcgill/e9dc40194a7defcd324071ad802f3fd4 to your computer and use it in GitHub Desktop.
Save geoffreymcgill/e9dc40194a7defcd324071ad802f3fd4 to your computer and use it in GitHub Desktop.
decimal d = 1.0M;
// Test decimal.
if (d == 1.0M)
{
Console.WriteLine(d);
}
decimal y = 0.5M;
// Add decimal.
y += d;
Console.WriteLine(y);
// Subtract and multiply decimal.
y -= (d * 2);
Console.WriteLine(y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment