On 7/24/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 7/24/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
> Chas Owens wrote:
snip
> > There are several ways to round a number, the easiest
> > (especially if you don't care how it is rounded) is to use
> > sprintf or printf:
snip
> If you really don't care how a number is rounded, then just replace
> it by zero.
snip

By "care how" I mean Banker's Rounding vs Normal Rounding.


BTW, these are only the two I use most often, there are bunches of
rounding algorithms that have different outputs.  For a non-exhaustive
list see http://support.microsoft.com/kb/196652.  Which one you use
depends heavily on what exactly you are trying to achieve with the
rounding; however, in most cases you don't care that much and just use
whatever algorithm sprintf implements on your system.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to