Table of Contents

Interface IPercentCalculatorDC

Namespace
SunamoDevCode._public
Assembly
SunamoDevCode.dll

EN: Interface for calculating percentages for progress tracking CZ: Rozhraní pro výpočet procent pro sledování postupu

public interface IPercentCalculatorDC
Extension Methods

Properties

Last

Gets or sets the last calculated percentage value.

double Last { get; set; }

Property Value

double

OverallSum

Gets or sets the total sum representing 100%.

double OverallSum { get; set; }

Property Value

double

Methods

AddOnePercent()

Adds one percent to the computed sum.

void AddOnePercent()

Create(double)

Creates a new percent calculator instance with the specified overall sum.

IPercentCalculatorDC Create(double overallSum)

Parameters

overallSum double

Total sum representing 100%.

Returns

IPercentCalculatorDC

A new percent calculator instance.

PercentFor(double, bool)

Calculates the percentage for the given value relative to the overall sum.

int PercentFor(double value, bool isLast)

Parameters

value double

Value to calculate percentage for.

isLast bool

Whether this is the last value in the sequence.

Returns

int

Calculated percentage as an integer.

ResetComputedSum()

Resets the computed sum back to zero.

void ResetComputedSum()