How to properly compare decimal values in C#?

Your code will work as expected. C# decimals are optimized to be very accurate at representing base 10 numbers, so if that’s what you’re comparing (money, …), everything should be fine.

Here’s a very clear explanation about the accuracy of decimals by Jon Skeet:

Difference between decimal, float and double in .NET?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)