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

roslyn in MVC

HTTP Error 500.0 - Internal Server Error Calling LoadLibraryEx on ISAPI filter "C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll" failed