Re: Rounding x to y decimal places (was Re: Int Function
Re: Rounding x to y decimal places (was Re: Int Function
- Subject: Re: Rounding x to y decimal places (was Re: Int Function
- From: Christopher Nebel <email@hidden>
- Date: Sun, 18 Aug 2002 21:13:57 -0700
On Sunday, August 18, 2002, at 08:58 PM, Timothy Bates wrote:
From: Christopher Nebel <email@hidden>
I tend to prefer "round" because it makes the intent more clear, and
it's more flexible -- you can use different rounding modes without
adding a lot of code that doesn't come naturally to non-numerics folk.
(Consider how many times people here have asked how to round a number
to n decimal places.)
But round doesn't do this...
It would be nice to have "decimal places" optional parameter [default
= 0]
Yes, I know -- I filed an enhancement request for this a while back.
(Actually, mine was for a rounding quantum, not merely a number of
decimal places. You could therefore round to the nearest 5, or 0.05,
or whatever.)
My point was that if people can't figure out how to round to n decimal
places by using primitive math functions, asking them to figure out how
to round in the various directions without using "round" is probably a
bit much. The dedicated speed geeks here are certainly welcome to cook
up their own functions, but I'd rather not inflict that on everyone.
--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.