Re: how to format decimal precision of a real?
Re: how to format decimal precision of a real?
- Subject: Re: how to format decimal precision of a real?
- From: has <email@hidden>
- Date: Sun, 3 Mar 2002 17:01:39 +0000
Emmanuel wrote:
>
>> The simplest answer is: 324.234234234 * 100 div 1 / 100
>
>
>
Not so sure it will work exactly as you expect.
>
>
-----------------------
>
324.21 * 100 div 1 / 100
>
-----------------------
>
>
324.2 <-- not a typo
Ugh, what a nasty little internal rounding error.
Off the top of my head, try:
((324.21 * 100) as string) div 1 / 100
It's a little slower, rather hackish and I hasn't been properly tested, but
might do the trick.
HTH
has
_______________________________________________
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.