Re: number with one decimal
Re: number with one decimal
- Subject: Re: number with one decimal
- From: Stan Cleveland <email@hidden>
- Date: Mon, 18 Jul 2011 12:59:34 -0700
On Jul 18, 2011, at 12:26 PM, Willem wrote: But, the strange thing is when aantalvragen is 10 and aantalgoed is 8 , then in line 3 resultaat is 82 (thats oke), but in line 4 its 8,19999999999999 (this should be 8,2)
So applescript thinks that 82 / 10 = 8,1999999999
It does not work to round things.
Hi Willem,
Here's a handler for truncating decimal numbers to a certain number of decimal places:
roundTo(3, 1,23456789) --> 1,235
on roundTo(numberOfPlaces, theNumber) return (round (theNumber * (10 ^ numberOfPlaces))) / (10 ^ numberOfPlaces) end roundTo
Stan C.
|
_______________________________________________
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