This is how I try to get the file size in MB:
FileInfo file_size = new FileInfo(list[i]);
double friendly_file_size = (file_size.Length / 1048576);
MessageBox.Show(friendly_file_size.ToString());
The problem is it does not show anything after comma.. when the file size is 3.15, it says 3. When it is 0.5, is says 0, what am I doing wrong?
That’s an integer division. Turn it into a floating point division by making at least one of the operands a floating pointer number:
or: