Re: Formatting a string with leading zeroes.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.



Relevant Pages

  • printing bits ... the right way
    ... \param str The array of characters where the resulting string is to ... \param format A custom format string specific to converting ... render an integer type into a binary string. ...
    (comp.lang.c)
  • Double Linked List
    ... 256 characters long identified in the input file F. Each identifier ... string is a string of characters representing the identifier itself. ... the file F which could not be classi ed in the lists NAMES, NUMBERS, ...
    (comp.lang.c)
  • Re: Reading LAST line from text file without iterating through the file?
    ... ASCII character values are limited to the 0-127 range. ... these days we use the 8th bit for accented characters instead ... Lines are a record format. ... way to represent an ArrayList<String> losslessly in a single String ...
    (comp.lang.java.programmer)
  • Re: Compare Instr() and IndexOf() performance
    ... The largest file is 780 kb, the format of the file is fixed length record ... (17 characters), I am always searching this files on first 10 characters ... but the contents of this file changes every ... If you just calculate the maximum number of string comparisions that may be ...
    (microsoft.public.dotnet.framework.compactframework)
  • Double Linked List Help
    ... 256 characters long identified in the input file F. Each identifier ... identifier, length is an integer representing the length of the ... string is a string of characters representing the identifier itself. ...
    (comp.lang.c.moderated)