Justin wrote:
I tried casting them to numeric and it was still wrong
How do the results differ from what you expect? You've posted a bunch of code, but haven't explained what you think is wrong with the results.
Can you post a couple of SMALL examples and explain how the results are different from what you expect them to be?
Try the example using the following formats for the literals in your test: 2.0 '2.0'::numeric (this is a BCD decimal) '2.0'::float4 (this is a C++/IEEE "float") '2.0'::float8 (this is a C++/IEEE "double") and see how the results differ. -- Craig Riniger