Padding Leading Zeros to a Number


Dim MyNumber As Integer = 472

TxtFormattedNumber.Text = MyNumber.ToString().PadLeft(5, "0")


------------------------Output---------------------------------------
00472

Comments

Popular posts from this blog

How to Stop Excel from giving a number in scientific notation

The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

System.IO.IsolatedStorage.IsolatedStorageException: Unable to create the store directory