Questions tagged [megabyte]

A megabyte is a unit of size of computer memory or storage.

A megabyte is a unit of size of computer memory or storage.

It is defined as 1,048,576 bytes, or 1024 kilobytes (each of which are 1024 bytes).

22 questions
167
votes
30 answers

Does .NET provide an easy way convert bytes to KB, MB, GB, etc.?

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} KB", x / 1024f); } etc...
John Smith
  • 4,416
  • 7
  • 41
  • 56
22
votes
8 answers

How to correctly convert filesize in bytes into mega or gigabytes?

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 I guess. The results always differ from those shown…
Mats
  • 14,902
  • 33
  • 78
  • 110
21
votes
8 answers

1 Mbit = ? bytes

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 == 131,072 bytes
Nate
  • 18,892
  • 27
  • 70
  • 93
16
votes
5 answers

MySQL Convert Bytes to Kilobytes, Megabytes, Gigabytes

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 return the value in MB but how do I continue to…
user2985091
  • 161
  • 1
  • 1
  • 6
2
votes
1 answer

Is it normal that a simple counter react app is more tham 100MB?

I am a newbie with React.js and just for practice i made a simple counter web app. But i noticed that the project is more than 120MB. Is it possible? do i need to do something to shrink it?
Rayden C
  • 139
  • 1
  • 6
2
votes
1 answer

Converting from bytes to GB or MB returns nothing

I got this code, which returns number of bytes: $size = Get-ChildItem $userAccount.homeDirectory -Recurse | Measure-Object -Property Length -Sum This works fine, but is not very user friendly, so I want to convert to megabytes or gigabytes. After…
Erik M.
  • 61
  • 7
2
votes
2 answers

Is possible to set hadoop blocksize 24 MB?

I just want to ask your opinion about HDFS block size. So I set HDFS block size to 24 MB and it's can run normally. I remember that 24 MB is not an exponential number (multiplication of 2) for the usual size on computer. So I want to ask all of you,…
1
vote
3 answers

Converting from bandwidth to traffic gives different results depending on operators position?

This must be a stupid question, but nevertheless I find it curious: Say I have a steady download of 128Kbps. How much disk space is going to be consumed after a hour in Megabytes? 128 x 60 x 60 / 8 / 1024 = 56.25 MB But 128 x 60 x 60 / 1000 /8 =…
SyRenity
  • 841
  • 5
  • 11
  • 18
1
vote
0 answers

How to Resize the images to set particular Megabyte using Python

I want to resize images by using Megabyte not by using resolution. I tried the code below: image = Image.open(full_path) image = image.resize((1900, 2400)) ImageFile.LOAD_TRUNCATED_IMAGES = True image.save(full_path) The code which was return…
1
vote
3 answers

Confusion calculating size between Bytes and Megabytes

This is a solved problem where the we have to find a missing integer from the input data which is in form of a file containing 4 billion unsorted unsigned integers. The catch is that only 10 MBytes of memory can be used. The author gives a solution…
rgamber
  • 5,749
  • 10
  • 55
  • 99
1
vote
1 answer

ioStat and Awk Output and Format with Megabyte and end of each field

Would it be possible to add a "Mb" to the end of just MB_r/s and MB_wn/s. Awk is getting 3 fields and reporting them during the test line to line like below: example: Format output below: ^ ^ …
Queasy
  • 131
  • 11
1
vote
2 answers

How do I convert the database size from mega bytes to bytes or vice-versa?

Basically I'm creating a replication application and I just need to figure out the database size and how much free space I have available on the D:\ drive. If the database size is larger than the free space, then I need to alert the user. This is…
JJ.
  • 9,580
  • 37
  • 116
  • 189
1
vote
1 answer

How to reduce page size with devexpress controls

I'm currently having an optimization problem with a page. This is a dashboard-like page, it contains and AspxNavBar (analogue of Accordion control) with 3 groups, groups contain 2 charts inside callback panel, 4 grids inside callback panel (1 main +…
Artur Udod
  • 4,465
  • 1
  • 29
  • 58
0
votes
2 answers

Ansible Need generic solution to find size of folder/directory or file

Im using stat module to get the size of folders and files like below: cat test.yml - name: "Play 1" hosts: localhost tasks: - name: Check file size stat: path: "{{ inputf }}" register: file_size - name: Report file…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
1 answer

suppose there is a computer with 18 bits address space and the cell size is 8 bits, then what is the smallest and highest address?

suppose there is a computer with 18 bits address space and the cell size is 8 bits, then What is the smallest and highest address? What will be the possible largest memory size of this computer in bytes, kilobytes and megabytes?
1
2