Namespace Codebelt.Unitify
The Codebelt.Unitify namespace offers types that simplify unit management with comprehensive metric and binary support for prefixes, multiples, and submultiples.
Availability: .NET 9 and .NET 8
Extension Methods
| Type | Ext | Methods | 
|---|---|---|
| Prefix | ⬇️ | ToPrefixUnit, ToBaseUnit | 
| PrefixTable | ⬇️ | QuectoOrDefault, RontoOrDefault, YoctoOrDefault, ZeptoOrDefault, AttoOrDefault, FemtoOrDefault, PicoOrDefault, NanoOrDefault, MicroOrDefault, MilliOrDefault, CentiOrDefault, DeciOrDefault, DecaOrDefault, HectoOrDefault, KiloOrDefault, MegaOrDefault, GigaOrDefault, TeraOrDefault, PetaOrDefault, ExaOrDefault, ZettaOrDefault, YottaOrDefault, RonnaOrDefault, QuettaOrDefault, KibiOrDefault, MebiOrDefault, GibiOrDefault, TebiOrDefault, PebiOrDefault, ExbiOrDefault, ZebiOrDefault, YobiOrDefault | 
| PrefixUnit | ⬇️ | ToPrefixValue, ToBaseValue, ToBaseUnit, ToPrefixString, ToMetricPrefixTable, ToDataPrefixTable | 
Classes
- BinaryPrefix
 Defines a binary unit prefix for multiples of measurement for data that refers strictly to powers of 2. This class cannot be inherited.
- DataPrefixTable
 Represents a table of both binary and metric prefixes for units of measure, optimized for data quantity and transmission measurement standards.
- DecimalPrefix
 Defines a decimal (metric) unit prefix for multiples and submultiples of measurement that refers strictly to powers of 10. This class cannot be inherited.
- MetricPrefixTable
 Represents a table of metric prefixes for units of measure, optimized for metric measurement standards.
- Prefix
 Represents the base class from which all implementations of unit prefix that can can be expressed as either a multiple or a submultiple should derive.
- PrefixExtensions
 Extension methods for the IPrefix interface.
- PrefixTable
 Represents a table of unit prefixes, indicating multiples or submultiples of a base unit.
- PrefixTableExtensions
 Extension methods for the PrefixTable class.
- PrefixUnit
 Represents the prefix of a unit of measurement.
- PrefixUnitExtensions
 Extension methods for the IPrefixUnit interfacce.
- PrefixUnitFormatter
 Defines the string formatting of objects having an implementation of IPrefixUnit.
- Unit
 Represents the base class from which all implementations of a unit of measure should derive.
- UnitFactory
 Provides a set of static methods for generating different types of unit of measure and the option to define your own with CreateUnit(string, string, string, double, IPrefix, Action<UnitFormatOptions>).
- UnitFormatOptions
 Configuration options for implementations of IBaseUnit.
- UnitFormatter
 Defines the string formatting of objects having an implementation of IUnit.
Structs
- BaseUnit
 Represents a base unit of measurement, including its category, name, and symbol.
Interfaces
- IBaseUnit
 Defines a base unit of measure, including its category, name, and symbol.
- IPrefix
 Defines a unit prefix that can can be expressed as either a multiple or a submultiple of the unit of measurement.
- IPrefixUnit
 Defines a unit of measurement that is used as a standard for measurement of the same kind of quantity. Any other quantity of that kind can be expressed as a multiple or fraction of the unit of measurement.
- IUnit
 Defines a unit of measure that is used as a standard for measurement of the same kind of quantity.
Enums
- NamingStyle
 Specifies ways that a string must be represented in terms of naming style.
- PrefixStyle
 Specifies ways that a string must be represented in terms of prefix style.