int number = 1234; //D6 = pad with 000000 string outputValue = String.Format("{0:D6}", number);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)