Table of Contents

ToPrefixString Method

Definition

Namespace
Codebelt.Unitify
Assemblies
Codebelt.Unitify.dll
Source
src/Codebelt.Unitify/PrefixUnitExtensions.cs

ToPrefixString(IPrefixUnit)

Converts the unit to its prefix string representation.

public static string ToPrefixString(this IPrefixUnit unit)

Parameters

unit IPrefixUnit

The IPrefixUnit to extend.

Returns

string

A string that represents that represents the first prefix greater or equal to one of the specified unit.

Exceptions

ArgumentOutOfRangeException

unit is not a Decimal (10) or Binary (2) prefix.

ArgumentNullException

unit cannot be null.