public void addPoportionally(int baseValue, int secondValue, Procent secondProcent) { if ((baseValue + secondValue) != 0) { set((this.get() * baseValue + secondProcent.get() * secondValue) / (float)(baseValue + secondValue)); } }
internal Procent HowMuchHaveOf(Value need) { if (need.value == 0) { return(new Procent(1f)); } else { return(Procent.makeProcent((int)this.value, (int)need.value)); } }
public Money Multiply(Procent multiplier, bool showMessageAboutNegativeValue = true) { Multiply(multiplier.get()); return(this); }
public void AddPoportionally(int totalValculatedValue, int nextElementValue, Procent elementProcent) { base.AddPoportionally(totalValculatedValue, nextElementValue, elementProcent); clamp100(); }
protected Procent100(Procent number) : base(number) { clamp100(); }
public Procent(Procent number) : base(number.get()) { }
public void add(Procent pro, bool showMessageAboutNegativeValue = true) { base.add(pro, showMessageAboutNegativeValue); //if (base.get() > 1f) // set(1f); }