|
@@ -4,6 +4,8 @@ package com.huimv.admin.common.utils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Random;
|
|
|
|
|
|
public class NumberUtils {
|
|
|
|
|
@@ -14,5 +16,13 @@ public class NumberUtils {
|
|
|
}
|
|
|
return df.format(Double.valueOf(str));
|
|
|
}
|
|
|
-
|
|
|
+ //num 是小数位数
|
|
|
+ public static String getNum(Integer min,Integer max, Integer num) {
|
|
|
+ Random rand = new Random();
|
|
|
+ int result = rand.nextInt(max - min ) +min;
|
|
|
+ if (num >0){
|
|
|
+ return result+"."+(rand.nextInt((int) Math.pow(10,num)));
|
|
|
+ }
|
|
|
+ return result+"";
|
|
|
+ }
|
|
|
}
|