return Utils.roundTo(Utils.getRandomFloat(max), scale);
}
+ static getRandomFloatFluctuatedRounded(staticValue: number, fluctuationPercent: number, scale = 2): number {
+ if (fluctuationPercent === 0) {
+ return Utils.roundTo(staticValue, scale);
+ }
+ const fluctuationRatio = fluctuationPercent / 100;
+ return Utils.getRandomFloatRounded(staticValue * (1 + fluctuationRatio), staticValue * (1 - fluctuationRatio), scale);
+ }
+
static cloneObject<T>(object: T): T {
return JSON.parse(JSON.stringify(object)) as T;
}