• 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
Rounding real numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rounding real numbers


  • Subject: Rounding real numbers
  • From: giZm0 <email@hidden>
  • Date: Sun, 28 Jan 2001 16:32:06 -0500

Hi,
i am uing a value qich is representing the amount of bytes of a specific
file. To get the number in megabytes instead, i worte this:

(thenumber / 1024) / 1024

Now, when i dialog this number it contains about 10 numbers after the point
(.). For example : 6.022548445
While i know this is normal, i would like to round this number to two
decimals only (6.02). Does anyone knows an easy way to do this ?

I could also delete the other decimals, without rounding... btu i dont know
how

giZm0


  • Prev by Date: Re: Conflict with Smile's Scripting Additions.
  • Next by Date: 'bzy ' files was: Re: R23's Osaxen Rant...
  • Previous by thread: Newbie-Question
  • Next by thread: Re: Rounding real numbers
  • Index(es):
    • Date
    • Thread