Custom numeric format strings | Microsoft Docs
docs.microsoft.com › en-us › dotnetNov 20, 2021 · Dim value As Double value = 123 Console.WriteLine(value.ToString("00000")) Console.WriteLine(String.Format("{0:00000}", value)) ' Displays 00123 value = 1.2 Console.Writeline(value.ToString("0.00", CultureInfo.InvariantCulture)) Console.Writeline(String.Format(CultureInfo.InvariantCulture, "{0:0.00}", value)) ' Displays 1.20 Console.WriteLine(value.ToString("00.00", CultureInfo.InvariantCulture)) Console.WriteLine(String.Format(CultureInfo.InvariantCulture, "{0:00.00}", value)) ' Displays 01 ...