P
Paul
Hi,
I am having some problems inserting floats using C#. I have a field in the
database that is a type float. I have a stored procedure that takes a type
float and inserts it into the database. However, when it gets int he
database, the numbers are inaccurate. For instance, when i am adding 27.1,
it stores it is as 27.1000003814697, 27.2 is 27.2999992370605. I am setting
the paramters, that i use for the stored proc like this:
System.Data.SqlClient.SqlParameter("@float_val ", SqlDbType.Float);
What is going on here? Is this a database issue or a C# issue? I can
manually change the value to 27.1 and it stores it like that, but when i am
using code to insert it, it messes up. Any ideas? Did i give enough
information?
Thanks,
Paul
I am having some problems inserting floats using C#. I have a field in the
database that is a type float. I have a stored procedure that takes a type
float and inserts it into the database. However, when it gets int he
database, the numbers are inaccurate. For instance, when i am adding 27.1,
it stores it is as 27.1000003814697, 27.2 is 27.2999992370605. I am setting
the paramters, that i use for the stored proc like this:
System.Data.SqlClient.SqlParameter("@float_val ", SqlDbType.Float);
What is going on here? Is this a database issue or a C# issue? I can
manually change the value to 27.1 and it stores it like that, but when i am
using code to insert it, it messes up. Any ideas? Did i give enough
information?
Thanks,
Paul