Subject Re: Round function ref/eDN8031797706
Author Svein Erling Tysvær
--- In firebird-support@yahoogroups.com, "Adam" wrote:
> --- In firebird-support@yahoogroups.com, "Praxi Technical Support -
> Dennis Th./F." wrote:
> >
> > Hello ppl
> >
> > Does any body knows or have a 'round' function in firebird like
> > the roundto of Delphi? I found a udf with a round in the
> > firebird's distribution but doesn't allow to define on which
> > decimal the round will be done.
> >
> > With few words, Do we have in firebird something like delphi's
> >
> Here are a few words.
>
> Make your own. Firebird supports custom written external functions
> that can do pretty much anything. Conversions like this is why they
> were designed.
>
> Delphi allows you to quite easily create a dll. You can make a
> simple wrapper function, declare the UDF in your database and your
> done. Google for some example functions in Delphi.
>
> Adam

Or you can just use the CAST function, e.g.

SELECT CAST(17.75*10 as Integer)/10.00
FROM RDB$DATABASE //This is just a table guaranteed to have 1 row

returns 17.80

Set