bytes size c#
public static string GetSizeInMemory(this long bytesize)
{
string[] sizes = { "B", "KB", "MB", "GB", "TB" };
double len = Convert.ToDouble(bytesize);
int order = 0;
while(len >= 1024D && order < sizes.Length - 1)
{
order++;
len /= 1024;
}
return string.Format(CultureInfo.CurrentCulture,"{0:0.##} {1}", len, sizes[order]);
}
Also in C#:
- make a list c#
- c# int
- @Html.ActionLink
- c# AllowSynchronousIO to true
- c# empty IEnumerable
- how to reference a child object unity
- c# list string return concatenate
- unity raycast 2d
- c sharp list indexer
- vb.net drag window without titlebar
- getcomponent c#
- unity set sprite transparency
- c# make string null
- edit bool from diffirent script
- same click event diffrenet buttonms c#
- how to add an embedded resource in visual studio code
- c# input integer
- c# graphics draw filled rectangle
- how to route back to url using Request.Headers["Referer"].ToString() in asp.net core
- unity switch to scene and transfer data
- .sh script: check if file exist
- how to see a tag of what you hit with raycast
- c# display float with 2 decimal places
- c# loop through object