Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Designer> Sql Server float and System.Double decimal points
 

Pages: 1
Designer
Sql Server float and System.Double decimal points
Page:1/1 

  Print all messages in this thread  
Poster Message
AlbertK
User



Location:

Joined on:
23-Dec-2009 17:51:37
Posted:
44 posts
# Posted on: 03-Dec-2013 17:54:32.  
Hello,
I'm using v3.1 build March 12th, 2012, .NET 4.0 and SQL Server 2008 R2.

I generated action stored procedure in the designer and the stored procedure has parameters of type float. Code generator created a proc wrapper with .NET parameter types System.Double. That's good.

When running SQL profiler, I've noticed that even though my values in .NET code only have 2 decimals, the proc is being called with lots of decimals.

For example, when value in .NET is 591215.52, the proc is getting called with 591215.52000000002

Do you know why this may be happening?

Thanks.
Albert
  Top
arschr
User



Location:
Atlanta, Georgia; USA
Joined on:
14-Dec-2003 16:57:29
Posted:
887 posts
# Posted on: 03-Dec-2013 20:39:59.  
Could it be because they are floats and 591215.52 when stored becomes 591215.520000000002?

- Al  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 04-Dec-2013 06:39:42.  
SQL float, is an approximate data type.
If you want to limit the number to a specific decimal points, then I'd suggest using SQL decimal(x, y) dataType.

ref http://stackoverflow.com/questions/1209181/what-represents-a-double-in-sql-server

  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.