• 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: Limiting Decimal Places in a Floating Variable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limiting Decimal Places in a Floating Variable?


  • Subject: Re: Limiting Decimal Places in a Floating Variable?
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 23 Nov 2000 10:26:42 -0800

On 11/23/00 3:34 AM, Nigel Garvey <email@hidden> wrote:

>>set x to -2134.2399999
>>set x to (round (x * 100) rounding toward zero) / 100
>
>Just out of curiosity, does this work with the number 8348.39 on your
>machine? Or 8348.29?

Sadly, no, it doesn't work with either of them.

>Incidentally, if you're in the market for a really fast way of
>multiplying by 100 and rounding towards zero:
>
> x div 0.01

Neat!

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------


  • Prev by Date: Re: Most Scriptable Apps (was: Re: Can a script receive
  • Next by Date: Re: HELP! PDF to EPS, how?
  • Previous by thread: Re: Limiting Decimal Places in a Floating Variable?
  • Next by thread: Re: Limiting Decimal Places in a Floating Variable?
  • Index(es):
    • Date
    • Thread