LIMIT DECIMALS

hi, does anyone knows how to limit decimals into 2 decimal places if your variable type is set as double

this implementation error for me.
Math.Round(Convert.ToDecimal(((cdbl(base1) * cdbl(dt_inputdata1.Rows(var_counter).Item(4))) * (1 - cdbl(dt_inputdata1.Rows(var_counter).Item(5))))), 2)

Error message : Cannot assign from type ‘System.Decimal’ to type ‘System.Double’ in Assign activity ‘Assign’.

Your Variable is Already in Double type. I Think there’s no need Convert.ToDecimal
try this one , I already Experience this.
math.Round((cdbl(base1) * cdbl(dt_inputdata1.Rows(var_counter).Item(4))) * (1 - cdbl(dt_inputdata1.Rows(var_counter).Item(5))),2)

Best Regards,
Aupe.

3 Likes

thank you, this helped a lot

1 Like

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