private static DecimalFormat df = new DecimalFormat( "0.00" ); private static double getValueRun(){ String str=df.format( Math.random()*100 ); return Double.valueOf(str); }
产生随机数并取特定的小数点位数
最新推荐文章于 2021-09-20 16:31:33 发布

private static DecimalFormat df = new DecimalFormat( "0.00" ); private static double getValueRun(){ String str=df.format( Math.random()*100 ); return Double.valueOf(str); }