Double number format: 0:n3 : String Format « Development « VB.Net

Double number format: 0:n3

Double number format: 0:n3
Imports System

Public Class MainClass
    Shared Sub Main()
        'Declare variable
        Dim dblNumber As Double

        'Set number, divide numbers, and display results
        dblNumber = 45.34
        dblNumber /= 4.333
        System.Console.WriteLine("Division test... " & dblNumber)
        System.Console.WriteLine("With formatting: " & String.Format("{0:n3}", dblNumber))
    End Sub

End Class


Related examples in the same category

1.String Format: CurrencyString Format: Currency
2.Proper Title Case
3.Assume en-US culture and standard format string
4.Format a string with composite string