• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dataport.AppFrameDotNet.DotNetTools.Collections
    • ExpressionHelper
    • NonRepeatableEnumerable<TType>
  • Dataport.AppFrameDotNet.DotNetTools.Collections.Extensions
    • Adding
    • Checking
    • Execution
    • ExpressionExtensions
    • Filtering
    • Indexing
    • Transformation
  • Dataport.AppFrameDotNet.DotNetTools.Collections.Model
    • PagedResult<TSource>
  • Dataport.AppFrameDotNet.DotNetTools.Comparison.Extensions
    • ComparisonExtensions
    • DictionaryExtensions
  • Dataport.AppFrameDotNet.DotNetTools.Comparison.Model
    • BoundaryType
    • IgnoreInPropertyComparisonAttribute
    • MemberComparisonResult
  • Dataport.AppFrameDotNet.DotNetTools.IO.Extensions
    • HttpStatusCodeExtensions
    • StreamExtensions
    • StringExtensions
  • Dataport.AppFrameDotNet.DotNetTools.Numeric.Extensions
    • Formatting
    • Percentage
    • Structure
  • Dataport.AppFrameDotNet.DotNetTools.Numeric.Model
    • PercentageType
  • Dataport.AppFrameDotNet.DotNetTools.Reflection
    • EnumHelper<TEnum>
  • Dataport.AppFrameDotNet.DotNetTools.Reflection.Extensions
    • AssemblyExtensions
    • EnumExtensions
    • InstanceExtensions
    • StringExtensions
    • TransformationExtensions
    • TypeExtensions
    • TypeManipulationExtensions
  • Dataport.AppFrameDotNet.DotNetTools.Text.Extensions
    • BooleanExtensions
    • StringExtensions
  • Dataport.AppFrameDotNet.DotNetTools.Time.Extensions
    • DateTimeExtensions
  • Dataport.AppFrameDotNet.DotNetTools.Time.Model
    • DateTimePart
  • Dataport.AppFrameDotNet.DotNetTools.Validation
    • ValidationResults
    • Verify
  • Dataport.AppFrameDotNet.DotNetTools.Validation.Extensions
    • ConditionExtensions
  • Dataport.AppFrameDotNet.DotNetTools.Validation.Models
    • Condition<T>
    • Severity

Class Percentage

Stellt Erweiterungsmethoden für Prozentrechnung mit numerischen Werten zur Verfügung.

Inheritance
System.Object
Percentage
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dataport.AppFrameDotNet.DotNetTools.Numeric.Extensions
Assembly: Dataport.AppFrameDotNet.DotNetTools.dll
Syntax
public static class Percentage

Methods

AsPercentageOf(Decimal, Decimal, PercentageType)

Gibt an, wie viel Prozent die übergebene Zahl in Relation zur Gesamtheit darstellt.

Declaration
public static decimal AsPercentageOf(this decimal i, decimal everything, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Decimal i

Die Zahl, die zu prüfen ist.

System.Decimal everything

Die gesamte Menge

PercentageType type

Der Typ in dem das Ergebnis zurückgegeben wird.

Returns
Type Description
System.Decimal

Der prozentuale Anteil der Zahl an der Gesamtheit.

Exceptions
Type Condition
System.ArgumentException

i oder everything sind kleiner als 0.

AsPercentageOf(Double, Double, PercentageType)

Gibt an, wie viel Prozent die übergebene Zahl in Relation zur Gesamtheit darstellt.

Declaration
public static double AsPercentageOf(this double i, double everything, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Double i

Die Zahl, die zu prüfen ist.

System.Double everything

Die gesamte Menge

PercentageType type

Der Typ in dem das Ergebnis zurückgegeben wird.

Returns
Type Description
System.Double

Der prozentuale Anteil der Zahl an der Gesamtheit.

Exceptions
Type Condition
System.ArgumentException

i oder everything sind kleiner als 0.

AsPercentageOf(Int16, Int16, PercentageType)

Gibt an, wie viel Prozent die übergebene Zahl in Relation zur Gesamtheit darstellt.

Declaration
public static float AsPercentageOf(this short i, short everything, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Int16 i

Die Zahl, die zu prüfen ist.

System.Int16 everything

Die gesamte Menge

PercentageType type

Der Typ in dem das Ergebnis zurückgegeben wird.

Returns
Type Description
System.Single

Der prozentuale Anteil der Zahl an der Gesamtheit.

Exceptions
Type Condition
System.ArgumentException

i oder everything sind kleiner als 0.

AsPercentageOf(Int32, Int32, PercentageType)

Gibt an, wie viel Prozent die übergebene Zahl in Relation zur Gesamtheit darstellt.

Declaration
public static float AsPercentageOf(this int i, int everything, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Int32 i

Die Zahl, die zu prüfen ist.

System.Int32 everything

Die gesamte Menge

PercentageType type

Der Typ in dem das Ergebnis zurückgegeben wird.

Returns
Type Description
System.Single

Der prozentuale Anteil der Zahl an der Gesamtheit.

Exceptions
Type Condition
System.ArgumentException

i oder everything sind kleiner als 0.

AsPercentageOf(Int64, Int64, PercentageType)

Gibt an, wie viel Prozent die übergebene Zahl in Relation zur Gesamtheit darstellt.

Declaration
public static float AsPercentageOf(this long i, long everything, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Int64 i

Die Zahl, die zu prüfen ist.

System.Int64 everything

Die gesamte Menge

PercentageType type

Der Typ in dem das Ergebnis zurückgegeben wird.

Returns
Type Description
System.Single

Der prozentuale Anteil der Zahl an der Gesamtheit.

Exceptions
Type Condition
System.ArgumentException

i oder everything sind kleiner als 0.

AsPercentageOf(Single, Single, PercentageType)

Gibt an, wie viel Prozent die übergebene Zahl in Relation zur Gesamtheit darstellt.

Declaration
public static float AsPercentageOf(this float i, float everything, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Single i

Die Zahl, die zu prüfen ist.

System.Single everything

Die gesamte Menge

PercentageType type

Der Typ in dem das Ergebnis zurückgegeben wird.

Returns
Type Description
System.Single

Der prozentuale Anteil der Zahl an der Gesamtheit.

Exceptions
Type Condition
System.ArgumentException

i oder everything sind kleiner als 0.

GetPercentageAmount(Decimal, Decimal, PercentageType)

Gibt zurück, wie groß ein prozentuale Anteil der übergebenen Zahl ist.

Declaration
public static decimal GetPercentageAmount(this decimal i, decimal percentage, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Decimal i

Die Zahl, die als 100% angenommen wird.

System.Decimal percentage

Der prozentuale Anteil

PercentageType type

Gibt an, wie percentage zu interpretieren ist.

Returns
Type Description
System.Decimal

Der prozentuale Anteil

GetPercentageAmount(Double, Double, PercentageType)

Gibt zurück, wie groß ein prozentuale Anteil der übergebenen Zahl ist.

Declaration
public static double GetPercentageAmount(this double i, double percentage, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Double i

Die Zahl, die als 100% angenommen wird.

System.Double percentage

Der prozentuale Anteil

PercentageType type

Gibt an, wie percentage zu interpretieren ist.

Returns
Type Description
System.Double

Der prozentuale Anteil

GetPercentageAmount(Int16, Single, PercentageType)

Gibt zurück, wie groß ein prozentuale Anteil der übergebenen Zahl ist.

Declaration
public static float GetPercentageAmount(this short i, float percentage, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Int16 i

Die Zahl, die als 100% angenommen wird.

System.Single percentage

Der prozentuale Anteil

PercentageType type

Gibt an, wie percentage zu interpretieren ist.

Returns
Type Description
System.Single

Der prozentuale Anteil

GetPercentageAmount(Int32, Single, PercentageType)

Gibt zurück, wie groß ein prozentuale Anteil der übergebenen Zahl ist.

Declaration
public static float GetPercentageAmount(this int i, float percentage, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Int32 i

Die Zahl, die als 100% angenommen wird.

System.Single percentage

Der prozentuale Anteil

PercentageType type

Gibt an, wie percentage zu interpretieren ist.

Returns
Type Description
System.Single

Der prozentuale Anteil

GetPercentageAmount(Int64, Single, PercentageType)

Gibt zurück, wie groß ein prozentuale Anteil der übergebenen Zahl ist.

Declaration
public static float GetPercentageAmount(this long i, float percentage, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Int64 i

Die Zahl, die als 100% angenommen wird.

System.Single percentage

Der prozentuale Anteil

PercentageType type

Gibt an, wie percentage zu interpretieren ist.

Returns
Type Description
System.Single

Der prozentuale Anteil

GetPercentageAmount(Single, Single, PercentageType)

Gibt zurück, wie groß ein prozentuale Anteil der übergebenen Zahl ist.

Declaration
public static float GetPercentageAmount(this float i, float percentage, PercentageType type = PercentageType.Arithmetic)
Parameters
Type Name Description
System.Single i

Die Zahl, die als 100% angenommen wird.

System.Single percentage

Der prozentuale Anteil

PercentageType type

Gibt an, wie percentage zu interpretieren ist.

Returns
Type Description
System.Single

Der prozentuale Anteil

In This Article
Back to top © 2020 Dataport AöR