Table of Contents

Method SizeToExplorerString

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SizeToExplorerString(long?, IFormatProvider?)

Returns the text representation of a file size in the style used by Windows File Explorer, with localizable unit strings.

public static string SizeToExplorerString(long? bytes, IFormatProvider? formatProvider = null)

Parameters

bytes long?

The file size in bytes.

formatProvider IFormatProvider

The format provider to use for formatting the file size. If null, the current culture is used.

Returns

string

File size string, e.g. "1.2 MB"