megabyte Questions

30

Solved

Just wondering if .NET provides a clean way to do this: int64 x = 1000000; string y = null; if (x / 1024 == 0) { y = x + " bytes"; } else if (x / (1024 * 1024) == 0) { y = string.Format("{0:n1} ...
Zounds asked 23/1, 2013 at 20:29

8

Solved

I'm using the DriveInfo class in my C# project to retrieve the available bytes on given drives. How to I correctly convert this number into Mega- or Gigabytes? Dividing by 1024 will not do the job ...
Earthquake asked 19/2, 2009 at 15:3

5

I have a logs table that stores various file sizes in bytes. I want to be able to query the database and return the smallest possible float which has been converted to MB GB etc. At present I can r...
Patency asked 11/1, 2014 at 1:20

8

Solved

I always get confused about this. Is there a "standard" conversion of Megabits to bytes? Is it: 1 Megabit == 1,000,000 bits == 125,000 bytes Or: 1 Megabit == 2^20 bits == 1,048,576 bits == 1...
Hyams asked 28/4, 2011 at 20:36
1

© 2022 - 2024 — McMap. All rights reserved.