SquirrelSizer 1.2.0

A simple and easy to use file sizing utility

Install-Package SquirrelSizer -Version 1.2.0
dotnet add package SquirrelSizer --version 1.2.0
<PackageReference Include="SquirrelSizer" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SquirrelSizer --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SquirrelSizer, 1.2.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SquirrelSizer as a Cake Addin
#addin nuget:?package=SquirrelSizer&version=1.2.0

// Install SquirrelSizer as a Cake Tool
#tool nuget:?package=SquirrelSizer&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

To use it is simple.

You give it a long number and it gives you a string with the size abbreviation suffix.

long number = 1024;
Sizer.GetSizeSuffix(number); // This will output 1.00kb

or

long number = 1024;
Sizer.GetSizeName(number); // This will output 1.00 Kilobyte

To use this with files is even as easy.

Sizer.GetSizeSuffix("C:\\Path\\To\\File\\file.txt"); // This will output the converted size of the file.

or

Sizer.GetSizeName("C:\\Path\\To\\File\\file.txt"); // This will output the converted size of the file.

You can even get the complete size of multiple files

List<string> files = new List<string>() {
            "C:\\Path\\To\\File\\file1.txt",
            "C:\\Path\\To\\File\\file2.txt",
            "C:\\Path\\To\\File\\file3.txt"
        };
Sizer.GetFullSizeSuffix(files); // This will output the size of all the files in the list

or

List<string> files = new List<string>() {
            "C:\\Path\\To\\File\\file1.txt",
            "C:\\Path\\To\\File\\file2.txt",
            "C:\\Path\\To\\File\\file3.txt"
        };
Sizer.GetFullSizeName(files); // This will output the size of all the files in the list

To use it is simple.

You give it a long number and it gives you a string with the size abbreviation suffix.

long number = 1024;
Sizer.GetSizeSuffix(number); // This will output 1.00kb

or

long number = 1024;
Sizer.GetSizeName(number); // This will output 1.00 Kilobyte

To use this with files is even as easy.

Sizer.GetSizeSuffix("C:\\Path\\To\\File\\file.txt"); // This will output the converted size of the file.

or

Sizer.GetSizeName("C:\\Path\\To\\File\\file.txt"); // This will output the converted size of the file.

You can even get the complete size of multiple files

List<string> files = new List<string>() {
            "C:\\Path\\To\\File\\file1.txt",
            "C:\\Path\\To\\File\\file2.txt",
            "C:\\Path\\To\\File\\file3.txt"
        };
Sizer.GetFullSizeSuffix(files); // This will output the size of all the files in the list

or

List<string> files = new List<string>() {
            "C:\\Path\\To\\File\\file1.txt",
            "C:\\Path\\To\\File\\file2.txt",
            "C:\\Path\\To\\File\\file3.txt"
        };
Sizer.GetFullSizeName(files); // This will output the size of all the files in the list

  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.0 179 7/7/2020
1.1.0 173 7/6/2020
1.0.2 260 2/17/2020