开发者

What type should I use in Database and Objects using Linq-to-SQL for floating point?

开发者 https://www.devze.com 2022-12-15 18:31 出处:网络
I have 2 fields and I need these to be a floating decimal point. I wonder what data type to use while I\'m开发者_开发知识库 designing bottom-up Linq-to-SQL classes.

I have 2 fields and I need these to be a floating decimal point. I wonder what data type to use while I'm开发者_开发知识库 designing bottom-up Linq-to-SQL classes.

EG: one value is 1.427600, another value is 1765.030, both would be in the same property/column.


Use System.Decimal, if you require the accuracy.

Decimal will represent both your example values accurately.


Why not a float or decimal type?

0

精彩评论

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