When running the query:
SELECT * FROM some_table WHERE id = 123
You rely on the user interface to format floating point numbers. The interface used uses two characters, not more. In the end, there is no information about the βrightβ show number.
You can convince the interface to display the correct number by formatting it as a string or decimal. For example:
select format(some_float_field, 3)
converts this to a string with three decimal places. One caveat: it will also add commas that you might not want. This should also work:
select cast(some_float_field as decimal(8, 3))
should also do the trick.
Note that you can easily verify the correctness of the data by doing something like:
select * from some_table where some_float_field between 1919.987 - 0.0001 and 1919.987 + 0.0001;
Note that you do not want to use = for floating point values, but you already understand that.
Gordon linoff
source share