Table of Contents

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
Prefix
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 string

The name of the binary unit.

symbol string

The symbol of the unit prefix.

base double

The number to be raised to a power.

exponent double

The number that specifies a power.

Fields

None

Defines a prefix multiple of none (0).

public static readonly IPrefix None

Field Value

IPrefix

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 double

The value of the unit prefix.

Returns

double

A 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 double

The value of the base unit.

Returns

double

A double that represents a unit prefix value.

ToString()

Returns a string that represents this instance.

public override string ToString()

Returns

string

A string that represents this instance.

See Also