Again i come back with one of my problems and queries.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace compare_string
{
class Program
{
static void Main(string[] args)
{
string str1 = "85.8500000000000";
string str2 = "85.85";
double num1 = Convert.ToDouble(str1);
double num2 = Convert.ToDouble(str2);
if (num1 != num2)
{
Console.WriteLine("Unequal");
}
else {
Console.WriteLine("Equal");
}
Console.ReadKey();
}
}
}
Why is give that the two numbers are unequal? Thanks in advance!
This is most probably related with your locale.
Try this, it should work
Alo try printing your numbers, you will see the difference.