Invoke code: Exception has been thrown by the target of an invocation / 2-digits-after-the-decimal-point

Hi @prasath_S

i use this invoke code and it was working
dt.AsEnumerable().ToList().ForEach(Sub(row) row(“Somme de Ratio”)= Math.round(cdbl(row(“Somme de Ratio”)),2))

but now i have this error :
image

i think its because i have empty cell now
image

Hi @Soudios

Please try this,

dt.asenumerable.Where(function(row) not String.IsNullOrEmpty(row("Somme de Ratio").ToString)).ToList().ForEach(Sub(row) row(“Somme de Ratio”)= Math.round(cdbl(row(“Somme de Ratio”)),2))

It is similar to this one,

Thanks

1 Like

Thank you @prasath_S as usual its perfect

1 Like

Glad that helped🙂

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.