format number with leading zeros
Published: 14. October 2011 | Updated: 14. October 2011License: Microsoft Public License (MS-PL)
Categories: Framework
Tags: C# Formatting Text
int number = 546; string formatted = number.ToString("000000"); Console.WriteLine(formatted);Console Output:
000546
| Send us feedback about this snippet » |





