I am calling a method that returns a decimal, which I need to display in a textbox.
tbxDisplayCost.Text = dinnerFun.CalcTotalCost(cbxHealthy.Checked);
It’s saying I can’t implicitly convert dec to string…
So I tried two things (probably incorrectly)
tbxDisplayCost.Text = dinnerFun.CalcTotalCost(cbxHealthy.Checked).ToString;
tbxDisplayCost.Text = (string)dinnerFun.CalcTotalCost(cbxHealthy.Checked);
Neither worked… and I’m kinda scratching my head to figure out how I can get that returned dec to be displayed in the textbox…
So close:
And if you don’t like the format when it comes out, you can tweak things with a standard or custom format string argument.