I have '9.999999999'::double precision
number and I want to convert it to decimal(8,2)
without any rounding. The result I am expecting is 9.99
. So far I tried:
select trunc('9.999'::double precision::numeric(8,3), 2)
and it works but I have to know number of precision digits for double precision value because if there will be more 9
then ::numeric(8,3)
will automatically round it to 10.000
.
What I can do about it?