Table of Contents

Interface IPercentCalculatorTog

Namespace
SunamoTextOutputGenerator._public.SunamoInterfaces.Interfaces
Assembly
SunamoTextOutputGenerator.dll

Interface for calculating percentages in text output generation.

public interface IPercentCalculatorTog
Extension Methods

Properties

Last

Gets or sets the last calculated value.

double Last { get; set; }

Property Value

double

OverallSum

Gets or sets the overall sum used for percentage calculations.

double OverallSum { get; set; }

Property Value

double

Methods

AddOnePercent()

Adds one percent to the computed sum.

void AddOnePercent()

Create(double)

Creates a new instance with the specified overall sum.

IPercentCalculatorTog Create(double overallSum)

Parameters

overallSum double

The total sum for percentage calculation.

Returns

IPercentCalculatorTog

A new percent calculator instance.

PercentFor(double, bool)

Calculates the percentage for a given value.

int PercentFor(double value, bool isLast)

Parameters

value double

The value to calculate percentage for.

isLast bool

Whether this is the last calculation in the sequence.

Returns

int

The calculated percentage as an integer.

ResetComputedSum()

Resets the computed sum to zero.

void ResetComputedSum()