I have a power table and the data i enter into a column might be something like 11.99 but when i pass this value to sql it passes 11.989997711. I want it to save to sql as 11.99 not 11.989997711.
Change the datatype in your table to DECIMAL(5,2)
Where do i change the data type for that column? When i view the table from the ‘Data’ property in designer it shows that column as double. Do you mean change it in SQL database?
In case anyone else is reading, you should know that this sort of this is always a possibility when working with floating point in computers. Because 11.99 doesn’t have a terminating binary fraction. Most PLC values are 32-bit floating point, while you say your column is defined as double, which is 64-bit. 32-bit floating point routines will generally round off at 6 or 7 significant digits to maintain the illusion that the binary fraction terminates, but storing a 32-bit float in a 64-bit double tricks the 64-bit routines – they don’t round until you have 16 or 17 significant digits.
As jpark says, use a decimal instead of a binary SQL datatype if floating point imprecision is a problem.