Float.parse of string number result in a another number in the DB
Why when I float.Parse a string "109.7" and inser开发者_高级运维t the result into the DB to a 'float' column I get 109.69999694824219 instead of 109.7?
I am using Microsoft SQL Server 2008 and C#. The string of the number is taken from a Text input field.
floats do not have full precision. You should use decimal.Parse instead.
精彩评论