blob: 2687e7c64c4a3f5a2fc53194c68bfcfc7ff1bfe6 [file] [log] [blame]
using System;
using System.Collections.Generic;
namespace AppsheetEpplus;
public class Rand : ExcelFunction {
private static int Seed { get; set; }
public override CompileResult Execute(
IEnumerable<FunctionArgument> arguments,
ParsingContext context) {
Seed = Seed > 50 ? 0 : Seed + 5;
var val = new Random(System.DateTime.Now.Millisecond + Seed).NextDouble();
return CreateResult(val, DataType.Decimal);
}
}