I have two values, one from user input and another from DB.
var userinput = form["someInput"];
var valuefromDB = GetValue(someNumber);
public float? GetValue(int id){
return (float?) db.table.where(p=> p.id == id).select(p=> p.Value).SingleOrDefault();
}
userinput have value "1" as string, while valuefromDB havevalue 0.001 as float.
so 1 / 0.001 = 1000
but my c# code give me 999.999939 as result;
var final = float.Parse(userinput) / valuefromDB
when i have "2" as user input value, result is correct, 2000...