获取很小的 随机数

This commit is contained in:
2025-01-13 18:42:09 +08:00
parent 3ac47228d1
commit 322074b4e0

View File

@@ -183,5 +183,12 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
receiveAsync(record);
});
}
public static BigDecimal getSmallDouble(int maxValue) {
Random random = new Random();
int value = random.nextInt(maxValue) * random.nextInt(maxValue);
return new BigDecimal(value / 100);
}
}