I am doing a little bit of mathematical calculations. Here is my code:
decimal FirstYr = decimal.Round((first / second), 5);
If I am passing first = 20
and second = 34
, I am getting the value of 0.58824 in FirstYr. Which is fine. Now I am doing this calculation here in my LINQ:
ev.HiComm = (float)(FirstYr * 100);
HiComm is float in the DB and this above calculation is passing value: 58.824001312255859
Which I dont want it. I want in my ev.HiComm = 58.824
What I am doing wrong here?