ReoGrid
ReoGrid copied to clipboard
ConvertData<T>(object data, out T value) System.OverflowException
sheet.GetCellData<decimal>(addrs);
Get the value of a formula cell. Formula (A/B) return NaN because B is 0. Runtime throws an exception: System. Overflow Exception: Value was either too large or too small for a Decimal.
I found that the error occurred in the class: Unvell. ReoGrid. Utility. CellUtility
public static bool ConvertData<T>(object data, out T value)
{
.....
value = (T)Convert.ChangeType(data, typeof(T));
return true;
}
Is it possible to change it to the following:
public static bool ConvertData<T>(object data, out T value)
{
...
if (data is double)
{
if (double.IsNaN((double)data) || double.IsInfinity((double)data))
{
data = 0;
}
}
value = (T)Convert.ChangeType(data, typeof(T));
return true;
}
@Ramon403 Thanks! I know this is old but could you please make a pull request for this?