Subject Re: [ib-support] "Bankers Rounding" Function
Author Hans Hoogstraat
There was an excellent solution posted a while back. Can you check the
history of this conf ?

----- Original Message -----
From: "C Fraser" <Colin.Fraser@...>
To: <ib-support@yahoogroups.com>
Sent: Tuesday, April 08, 2003 11:30 PM
Subject: [ib-support] "Bankers Rounding" Function


> Hi,
>
> Is there an easy way to get "Bankers" or unbiased rounding of numbers in
> Interbase/Firebird?? A function or UDF available?
>
> Just to explain... using 0.145 FormatFloat in Delphi gives 1.5, where as
> FormatCurr gives 1.4 (though the documentation wouldn't give you any
> clue about this).
>
> In our apps we have used FormatCurr and Format('%m', [0.145]) but this
> does not equal what the database spits out... We have determined it is
> because IB/Firebird always rounds up (biased rounding) which is fine,
> just wondering if there is a function to do what we are after
> (otherwise, we shall change all our code to use FormatFloat instead, not
> tooooo much of a biggie).
>
> Regards
>
> Colin
>
>
> ######################################################################
> Attention:
> The information in this email and in any attachments is confidential.
> If you are not the intended recipient then please do not distribute,
> copy or use this information. Please notify us immediately by return
> email and then delete the message from your computer.
> Any views or opinions presented are solely those of the author.
> ######################################################################
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>