473.22000000000025 instead of 473.22 ???

  • Thread starter Thread starter Chris Tacke, eMVP
  • Start date Start date
Hi all,

when I run this code:

string sNum1 = "5000"
string sNum2 = "4526.78";

double dNum = double.Parse(sNum1);
dNum = dNum - double.Parse(sNum2 );
===============================

dNum is equal 473.22000000000025 instead of 473.22.
Why does it hapened?

At the end of my calculation, I have to get zero but I get 0.00000000025

what can I do?

Thanks,
Ofer
 
Back
Top