I have this code, and I have been looking for a way to simplify it using a ternary operator, but I can not because it says I can not use decimal in string:
decimal per;
if (nud_qtPedida.Value != 0)
per = nud_qtFornecida.Value * 100 / nud_qtPedida.Value;
else
per = 0;
txt_percentagem.Text = per.ToString();