Trying to convert value into GB

Hi i am using MBS Util plugin to return a drive size

format(f.VolumeSizeMBS/1024.0/1024.0/1024.0,"0.0")+" GBytes"

My HDD size is 652GB, but the above only returns: 607GB

Is there a way to calculate drive size and free space native in XOJO or can some please help with the above MBS issue?

Thanks

is that on Mac OS X?

for Mac OS X in newer versions you use /1000 not /1024.

Depends on how you define a Gigabyte [base 10 or base 2]

normally it is 1,073,741,824 bytes, not 1,000,000,000 (which is a billion bytes)

http://en.wikipedia.org/wiki/Gigabyte

for storage, ENGINEERING sizes are /1024. for MARKETING/SALES sizes it is /1000

plus the Volume size might not show the FULL disk as you have to partition the drive and create a filesystem that take overhead. Not sure if that is taken into account.

sb

Linux, most probably.

Ought VolumeSizeMBS to return the size of the HDD or of the partition? I guess that is where the difference could come from.

It’s also related to the advertised capacity versus the actual, usable capacity. For example, a 250GB drive has 238GB usable. A 2TB disk has 1.83TB usable.

I suspect that what you’re seeing, Jay, is actually correct.

Well, Tim, advertised is calculated with /1000, but usable was for long calculated with /1024.
Nowadays Apple divides usable also with /1000, so the numbers advertised and shown in Finder match.