Class Prefix
- Namespace
- Codebelt.Unitify
- Assembly
- Codebelt.Unitify.dll
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.
public abstract class Prefix : IPrefix
- Inheritance
-
ObjectPrefix
- Implements
- Derived
- Extension Methods
Constructors
Prefix(String, String, Double, Double)
Initializes a new instance of the Prefix class.
protected Prefix(string name, string symbol, double base, double exponent)
Parameters
name
StringThe name of the binary unit.
symbol
StringThe symbol of the unit prefix.
base
DoubleThe number to be raised to a power.
exponent
DoubleThe number that specifies a power.
Fields
None
Defines a prefix multiple of none (0).
public static readonly IPrefix None
Field Value
Properties
Base
Gets the number to be raised of the unit prefix.
public double Base { get; }
Property Value
- Double
The number to be raised of the unit prefix.
Exponent
Gets the exponent of the unit prefix.
public double Exponent { get; }
Property Value
- Double
The exponent of the unit prefix.
Multiplier
Gets the unit prefix multiplier.
public double Multiplier { get; }
Property Value
- Double
The unit prefix multiplier.
Name
Gets the name of the unit prefix.
public string Name { get; }
Property Value
- String
The name of the unit prefix.
Symbol
Gets the symbol of the unit prefix.
public string Symbol { get; }
Property Value
- String
The symbol of the unit prefix.
Methods
ToBaseValue(Double)
Converts the unit prefixValue
back to a unit base value.
public double ToBaseValue(double prefixValue)
Parameters
prefixValue
DoubleThe value of the unit prefix.
Returns
- Double
A System.Double that represents a unit base value.
ToPrefixValue(Double)
Converts the unit base baseValue
to a unit prefix value.
public double ToPrefixValue(double baseValue)
Parameters
baseValue
DoubleThe value of the base unit.
Returns
- Double
A System.Double that represents a unit prefix value.
ToString()
Returns a System.String that represents this instance.
public override string ToString()
Returns
- String
A System.String that represents this instance.