• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to format decimal precision of a real?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Thank you very much!
      • From: Martin Michel <email@hidden>
  • Prev by Date: Re: How to delete text items?
  • Next by Date: Thank you very much!
  • Previous by thread: Re: how to format decimal precision of a real?
  • Next by thread: Thank you very much!
  • Index(es):
    • Date
    • Thread