Formatting a string with leading zeroes.

  • Thread starter Thread starter Andrew Chalk
  • Start date Start date
A

Andrew Chalk

If I have a number representing a number of minutes and I want to format it
as a string with two characters, with a leading 0 if the value is less than
10, how do I do that?

Many thanks.
 
Andrew,
If I have a number representing a number of minutes and I want to format it
as a string with two characters, with a leading 0 if the value is less than
10, how do I do that?

number.ToString("00")


Mattias
 

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