2012年3月27日星期二

float datatype

I have several fields in a table with a float datatype. When the user
enters 1.1 into the database, it returns 1.1000000000000001 -- I would think
it should be 1.1000000000000000.
Won't this eventually cause mathematically errors and what do I do about
this.FLOAT is an approximate numeric type. If you require accurate,
fixed-precision results from calculations then use an exact type such as
NUMERIC.
--
David Portas
SQL Server MVP
--

没有评论:

发表评论