Re: Same code gives different answers in 2 different scripts
Re: Same code gives different answers in 2 different scripts
- Subject: Re: Same code gives different answers in 2 different scripts
- From: Chris Page <email@hidden>
- Date: Tue, 02 Jun 2009 15:52:17 -0700
On Jun 2, 2009, at 3:19 PM, Rob Lewis wrote: Do you have a better rounding algorithm that will fix this?
Are you aware there’s a standard “round” command in Standard Additions? Try this instead of doing your own rounding:
property form_height : ((1.75 - 0.7) * 72) --=75.6
to findRound of num given numDecimals:n set x to 10 ^ n return (round (num * x)) / x end findRound
set rounded_height to findRound of form_height given numDecimals:2
-- Chris Page
The other, other AppleScript Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden