bytes to megabytes
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.