formatting text in textbox as currency question

  • Thread starter Thread starter Gen
  • Start date Start date
G

Gen

I have a simple program that takes 3 values (balance, interest, desired
payment) and calculates how many months to pay the balance, and each month's
accrued interest, and remaining balance. However I do not know how to
display the results to 2 decimal places.

At this time all results are displayed as one big string in a large text box
with it's multi-line property set to true. I found something called a
format character but it didn't work in my code.

when I do this:
sResults = sResults + ("{0:N}", mAccruedInterest);

it gives me the squiggly red line under the comma and under mAccruedInterest
and it says ") expected", "invalid expression term ',' " and "; expected".

thanks
 
Gen said:
when I do this:
sResults = sResults + ("{0:N}", mAccruedInterest);
it gives me the squiggly red line under the comma

sResults = sResults + String.Format("{0:N}", mAccruedInterest);

P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top