[Solved] how to convert decimal value into int in c# [closed]


As per your requirement, round decimal up to 2 place using following way :

1) Use Math.Round().

 var vatprice= Convert.ToDecimal(Math.Round(dt.Rows[0][5], 2));

2) second way is

var vatprice=Convert.ToDecimal(dt.Rows[0][5].ToString ("#.##"));

solved how to convert decimal value into int in c# [closed]