物品:获取装备上限
This commit is contained in:
@@ -251,7 +251,8 @@ export function getRandValue(base: number, ratio: number, decimal = 2): number {
|
||||
* @param decimal 返回值保留的小数位数
|
||||
*/
|
||||
export function getRandValueByMinMax(min: number, max: number, decimal = 2): number {
|
||||
return parseFloat((min + (max - min) * Math.random()).toFixed(decimal));
|
||||
let pow = Math.pow(10, decimal);
|
||||
return Math.floor((min + (max - min) * Math.random()) * pow)/pow;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user