VB.Net Program to Print Given Number in Different Formats Using Format() Function

You are currently viewing VB.Net Program to Print Given Number in Different Formats Using Format() Function

VB.Net program to print given number in different formats using Format() function

'VB.Net program to print a number in different 
'formats using Format() function.

Module Module1

    Sub Main()
        Dim result As String
        Dim num As Integer = 12345678

        result = Format(num, "General Number")
        Console.WriteLine(result)

        result = Format(num, "Fixed")
        Console.WriteLine(result)

        result = Format(num, "Standard")
        Console.WriteLine(result)

        result = Format(num, "Currency")
        Console.WriteLine(result)

        result = Format(num, "Percent")
        Console.WriteLine(result)
    End Sub
    
End Module

Output

12345678
12345678.00
12,345,678.00
$12,345,678.00
1234567800.00%
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply