Skip to content

Commit

Permalink
Fix #179
Browse files Browse the repository at this point in the history
  • Loading branch information
sys27 committed Apr 30, 2018
1 parent f618f4f commit 3eb5e60
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion xFunc.Maths/Expressions/Collections/Parameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,28 @@ public object Value
}
set
{
this.value = !(value is bool) ? Convert.ToDouble(value) : value;
if (IsNumber(value))
value = Convert.ToDouble(value);

this.value = value;
}
}

private static bool IsNumber(object value)
{
return value is sbyte ||
value is byte ||
value is short ||
value is ushort ||
value is int ||
value is uint ||
value is long ||
value is ulong ||
value is float ||
value is double ||
value is decimal;
}

/// <summary>
/// Gets or sets the type of parameter.
/// </summary>
Expand Down

0 comments on commit 3eb5e60

Please sign in to comment.