Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Display a 16-bit unsigned integer value by using each standard format string and some custom format strings

Imports System.Globalization Module Example    Public Sub Main()       Dim value As UShort = 9       Dim specifiers() As String = { "G", "C", "D3", "E2", "e3", "F", _                                      "N", "P", "X", "000000.0", "#.0", _                                      "00000000;(0);**Zero**" }       For Each specifier As String In specifiers          Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier))       Next    End Sub End Module