code: private static Decimal randDecimal(Decimal min, Decimal max) {
          Decimal randomDecimal = null;
          if (min != null && max != null && min.isLessThan(max)) {
              randomDecimal = max.minus(min).multipliedBy(Decimal.valueOf(Math.random())).plus(min);
          }
          return randomDecimal;
      }
docs: Generates a random decimal number between min and max.
  @param min the minimum bound
  @param max the maximum bound
  @return a random decimal number between min and max