try
{
text = (Math.Round(Convert.ToDecimal(text), 2)).ToString();
if (!string.IsNullOrEmpty(text) && text != " ")
{
if (text.Contains("*")) text = text.Replace("*", "");
if (text.Contains("+"))
{
string[] s = text.Split('+');
decimal d=0;
for (int i = 0; i < s.Length; i++) d +=Convert.ToDecimal(s[i]);
text = d.ToString();
}
}
return text;
}
catch (Exception) { return text; }
الان به جای اینکه تکست خالی و به صورت null برگردونه در صورتی که نتونه توی خط اول بعد try عمل round و انجام بده برنامه متوقف میشه و اکسپشنی پرتاب نمیشه