Re: Fraction Maker
Re: Fraction Maker
- Subject: Re: Fraction Maker
- From: Martin Orpen <email@hidden>
- Date: Wed, 20 Oct 2004 17:38:20 +0100
on 20/10/04 2:44 pm, Jason Bourque at email@hidden wrote:
> Does anyone have a Fraction Maker?
>
> I have the larger value 1 and a smaller decimal .66
>
> And I want to get 2/3. I now it will take some rounding.
>
> I appreciate the help.
Interesting problem.
Haven't thought about scripting that sort of thing, but I'd guess the
approach would be to multiply 0.66 by a series of numbers to see how close
you can get to a whole number:
0.66 * 2 = 1.32
0.66 * 3 = 1.98
0.66 * 4 = 2.64
3 is about as close as we'll get, so the fraction is 1.98 rounded to 2 over
3
Not quite sure what the most effective number range would be, as you can see
the same result would be generated using 30:
0.66 * 30 = 19.8
Which would round to 20/30 and could then be rounded down to 2/3
HTH
--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden