Sorry, but it is difficult for me to think that you know the debugger as you claim. Your inability to solve this problem is contradictory with the knowledge of debugger.
Try those changes with debugger and see what go wrong.
s1 = 0.1700
t1 = 168.62
t7 = 100.012
a = (t7 * s1) + t1
a = 123.45
tbTrkFuelPurch1.Text = a.ToString("C2")
if output is 0, it is formatting problem.
if
a
get calculated, it is conversion from string problem.
It is incredible that you didn't do those testes by your own to see where is the problem.
[Update]
The word Debug is 2 times in your question. If you don't say that you don't master the debugger, everyone will expect that you do.
My advice: learn the debugger as soon as possible.
-set a breakpoint at beginning of your routine.
-open the local variables window.
-execute step by step you program ans see which line is executed and see how variables evolves.
In first part of my code, I force valid values in variables and compute
a
. Should not be complicated to see if
a
remain 0 or not.
Is second part I set
a
with a valid value, should not be complicated to see if formatting is ok or not.
if you are the author of this code, you should be able to change it in order to do the tests.