Wednesday, March 7, 2012

Rounding Error?

I'm passing a value from an ASP.net app to an sql stored procedure which stores it in a table.

Problem is if, for example, the value is 2.81 the value is ending up as 2.08999... in my table, but if i do say 6.3 it's fine.

Ive tried having the variable in asp and the field where its stored in sql as a number of types but all with the same result.

Any ideas?

Geoff.You should check the definition and precision of your database column.
Maybe change it from float to money.

Regards
Fredrik

No comments:

Post a Comment