Re: simple number question
Re: simple number question
- Subject: Re: simple number question
- From: Michelle Steiner <email@hidden>
- Date: Mon, 23 Dec 2002 22:33:17 -0700
On Monday, December 23, 2002, at 07:20 PM, Peter Kincaid wrote:
how do I get a equation to return a number rounded to the nearest tenth
rather than a whole slew of numbers
ex 10 / 3 = 3.33 instead of
10 / 3 = 3.33333333333
Here is a generalized solution:
set x to round_a_number(10, 3, 2)
to round_a_number(numerator, denominator, decimal_places)
set places to 10 ^ decimal_places
set x to (round (numerator / denominator) * places) / places as real
end round_a_number
--Michelle
Never play strip Tarot.
_______________________________________________
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.