using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 垂直剖面动态观测系统.Common { static class RandomNumber { public static double NextDouble(this Random ran, double minValue, double maxValue) { return ran.NextDouble() * (maxValue - minValue) + minValue; } /// /// 随机生成小数 /// /// /// /// /// /// public static double NextDouble(this Random ran, double minValue, double maxValue, int decimalPlace) { double randNum = ran.NextDouble() * (maxValue - minValue) + minValue; return Convert.ToDouble(randNum.ToString("f" + decimalPlace)); } } }