Show / Hide Table of Contents

Struct Percentage

Percentage struct type for handling percentages

Implements
IEquatable<Percentage>
Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct Percentage : IEquatable<Percentage>

Constructors

View Source

Percentage(double)

Handle percentages

Declaration
public Percentage(double percentage)
Parameters
Type Name Description
double percentage

Value of the percentage between 0 and 100%

Properties

View Source

Value

Declaration
public double Value { get; set; }
Property Value
Type Description
double

Methods

View Source

Equals(Percentage)

Status of Equals

Declaration
public bool Equals(Percentage percentage)
Parameters
Type Name Description
Percentage percentage

Percentage object

Returns
Type Description
bool

True is they are the same, otherwise false including when obj is null

View Source

Equals(object)

Status of Equals

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

object

Returns
Type Description
bool

True is they are the same, otherwise false including when obj is null

Overrides
ValueType.Equals(object)
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

PercentageOf(double)

Calculate the percentage of a value

Declaration
public double PercentageOf(double value)
Parameters
Type Name Description
double value

Value that percentage will be applied

Returns
Type Description
double

double: Percentage of the value

Operators

View Source

operator /(Percentage, double)

Operator division of a percentage object and double

Declaration
public static double operator /(Percentage percentage, double value)
Parameters
Type Name Description
Percentage percentage

First operand of the division

double value

Second operand of the division

Returns
Type Description
double

double object of division

View Source

operator ==(Percentage, Percentage)

Declaration
public static bool operator ==(Percentage a1, Percentage a2)
Parameters
Type Name Description
Percentage a1
Percentage a2
Returns
Type Description
bool
View Source

operator !=(Percentage, Percentage)

Declaration
public static bool operator !=(Percentage a1, Percentage a2)
Parameters
Type Name Description
Percentage a1
Percentage a2
Returns
Type Description
bool
View Source

operator *(Percentage, double)

Operator multiplication of a percentage object and double

Declaration
public static double operator *(Percentage percentage, double value)
Parameters
Type Name Description
Percentage percentage

First operand of the multiplication

double value

Second operand of the multiplication

Returns
Type Description
double

double object of multiplication

Implements

IEquatable<T>
  • View Source
In this article
Back to top Copyright 2018-2025 CADology Limited