LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Committing a "double" data type to a Numeric field in SQL Server using DB Connectivity toolkit

Will this have the desired effect? I trust that the server would parse the float as a numeric(9,0), but is there anything I can do to make sure this goes as smoothly as possible? I think Display Format won't do anything, and the native LV data types don't have an equivalent. What do I do?

0 Kudos
Message 1 of 2
(2,718 Views)

Yes, I believe SQL Server will round the number. You should be able to easily test it to be sure with some out-of-range numbers and numbers with different precisions.

 

To do the conversion yourself, you could multiply the number by the number of digits after the decimal, round to nearest integer and then divide again to get the rounded version of the number.

 

You could also convert to string with the required formatting/precision and then convert it back to a DBL.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 2
(2,691 Views)