diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 5184bce79..38a212ca2 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -129,7 +129,8 @@ export default class Utils { if (fluctuationPercent === 0) { return Utils.roundTo(staticValue, scale); } - return Utils.getRandomFloatRounded(staticValue + staticValue * (fluctuationPercent / 100), staticValue - staticValue * (fluctuationPercent / 100), scale); + const fluctuationRatio = fluctuationPercent / 100; + return Utils.getRandomFloatRounded(staticValue * (1 + fluctuationRatio), staticValue * (1 - fluctuationRatio), scale); } static cloneObject(object: T): T {