Fixed flea offer item count + cultist circle rouble value being incorrect when using randomUtil.GetPercentOfValue
This commit is contained in:
@@ -80,20 +80,6 @@ public class RandomUtil(ISptLogger<RandomUtil> logger, ICloner cloner)
|
||||
return Math.Round(num, toFixed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the percentage of a given number and returns the result.
|
||||
/// </summary>
|
||||
/// <param name="percent">The percentage to calculate.</param>
|
||||
/// <param name="number">The number to calculate the percentage of.</param>
|
||||
/// <param name="toFixed">The number of decimal places to round the result to (default is 2).</param>
|
||||
/// <returns>The calculated percentage of the given number, rounded to the specified number of decimal places.</returns>
|
||||
public virtual int GetPercentOfValue(double percent, int number, int toFixed = 2)
|
||||
{
|
||||
var num = percent * (number / 100);
|
||||
|
||||
return (int)Math.Round(num, toFixed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the percentage of a given number and returns the result.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user