开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜