• 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
bytes to megabytes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bytes to megabytes


  • Subject: bytes to megabytes
  • From: "ken " <email@hidden>
  • Date: Mon, 23 Sep 2002 14:16:52 -0500

I was looking in the AS Guidebook for something and stumbled
across a piece of code that has me scratching my head. The more
I scratch, the less I understand it (and the more hair keeps falling
out!)

--> returns 2 decimal value in megabytes: 774.76
tell application "Finder"
set this_disk to disk "VST Drive"
set free_space to (free space of this_disk) / 1048 / 1000
set the whole_value to free_space div 1
set the decimal_remainder to (free_space mod 1) * 100 div 1 *
0.01
set free_space to whole_value + decimal_remainder
end tell

Okay. I understand why they are dividing and then using the
div/mod operators. What I don't get is why they used 1048 then
1000? Shouldn't it be 1024 and 1024? I really don't get what they
did here...

Ken
_______________________________________________
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:
    • Re: bytes to megabytes
      • From: Shane Stanley <email@hidden>
    • Re: bytes to megabytes
      • From: email@hidden (Michael Sullivan)
  • Prev by Date: How to use "Check for new mail" feature
  • Next by Date: How to?!
  • Previous by thread: Re: How to use "Check for new mail" feature
  • Next by thread: Re: bytes to megabytes
  • Index(es):
    • Date
    • Thread