Interface IPercentCalculatorTog
- 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
OverallSum
Gets or sets the overall sum used for percentage calculations.
double OverallSum { get; set; }
Property Value
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
overallSumdoubleThe 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
valuedoubleThe value to calculate percentage for.
isLastboolWhether 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()