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
OverallSum
Gets or sets the total sum representing 100%.
double OverallSum { get; set; }
Property Value
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
overallSumdoubleTotal 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
valuedoubleValue to calculate percentage for.
isLastboolWhether 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()