Fix NCalc type error when evaluating AI-generated formulas

NCalc2 operates on double internally; passing decimal parameters caused
'Operator * cannot be applied to double and decimal' at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 14:27:42 -04:00
parent 1a6f855c05
commit c3742e1585
@@ -181,7 +181,7 @@ Rules:
foreach (var kv in variables)
{
expr.Parameters[kv.Key] = kv.Value.ValueKind == JsonValueKind.Number
? (object)kv.Value.GetDecimal()
? (object)kv.Value.GetDouble()
: (object)(kv.Value.GetString() ?? "");
}