Vladimir Nicolici <vladnc@gmail.com> writes:
> I do that, but its extremely annoying.
Well, if it rises to the level of extreme annoyance for you, there
is a simple solution:
create function round(float8, int) returns numeric as
'select round($1::numeric, $2)' language sql;
> Furthermore, since the single parameter version accepts double precision numbers, the imprecise representation excuse
seemsquestionable at best.
The single-parameter version always rounds to integer, which avoids the
problem of not being able to represent decimal fractions exactly.
regards, tom lane