what is the formula to convert bytes to KiloBytes, MegaBytes, and Gigabytes????
Printable View
what is the formula to convert bytes to KiloBytes, MegaBytes, and Gigabytes????
Well first of all, it depends how you want to do it. When your computer boots im sure you've noticed that when it counts RAM, it says a number slightly larger than the amount of RAM you think you have. Thats because 1KB = 1024bytes, not 1000. If you right click on My Computer and go to properties, you'll see the number you except. But windows is assuming that 1KB = 1000bytes. Which do you want to use?
1 KB = 1024 B
1 MB = 1048576 B = 1024 KB
1 GB = 1073741824 B = 1048576 MB
So... the formula is
X KB = NumberOfBytes/1024
X MB = NumberOfBytes/1048576 'or X MB = NumberOfBytes/1024/1024
etc, etc.
Thanks,
how come when I use the file system object, the property size is less than the actual bytes used(which you can see if you access the folder through explorer?... the file system object returns the folder size, but the actual bytes used should be a little more. How do I get the actual bytes used and the "actual" free space? and the actual totol size of a drive/folder/ etc.....
I think Mc Brain meant that 1 gig is 1048576 KB not MB
Sorry.....Quote:
Originally posted by BuggyProgrammer
I think Mc Brain meant that 1 gig is 1048576 KB not MB
1 KB = 1024 B
1 MB = 1048576 B = 1024 KB
1 GB = 1073741824 B = 1048576 KB = 1024 MB