Format a negative integer or floating-point number in Number format : Console Format « Development « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Development » Console FormatScreenshots 
Format a negative integer or floating-point number in Number format
 
Imports System
Imports Microsoft.VisualBasic

Class Sample

   Public Shared Sub Main()
      Console.WriteLine("(C) Currency: . . . . . . . . {0:C}" & vbCrLf & _
                        "(D) Decimal:. . . . . . . . . {0:D}" & vbCrLf & _
                        "(E) Scientific: . . . . . . . {1:E}" & vbCrLf & _
                        "(F) Fixed point:. . . . . . . {1:F}" & vbCrLf & _
                        "(G) General:. . . . . . . . . {0:G}" & vbCrLf & _
                        "    (default):. . . . . . . . {0} (default = 'G')" & vbCrLf & _
                        "(N) Number: . . . . . . . . . {0:N}" & vbCrLf & _
                        "(P) Percent:. . . . . . . . . {1:P}" & vbCrLf & _
                        "(R) Round-trip: . . . . . . . {1:R}" & vbCrLf & _
                        "(X) Hexadecimal:. . . . . . . {0:X}" & vbCrLf, _
                        123, - 123.45F)

   End Sub
End Class

   
  
Related examples in the same category
1.Format a negative integer or floating-point number in Currency format
2.Format a negative integer or floating-point number in Decimal format
3.Format a negative integer or floating-point number in Scientific format
4.Format a negative integer or floating-point number in Fixed point format
5.Format a negative integer or floating-point number in General format
6.Format a negative integer or floating-point number in default format
7.Format a negative integer or floating-point number in Percent format
8.Format a negative integer or floating-point number in Round-trip format
9.Format a negative integer or floating-point number in Hexadecimal format
10.Format the current date in (d) Short date
11.Format the current date in (D) Long date
12.Format the current date in (t) Short time
13.Format the current date in (T) Long time
14.Format the current date in (f) Full date/short time
15.Format the current date in (F) Full date/long time
16.Format the current date in (g) General date/short time
17.Format the current date in (G) General date/long time
18.Format the current date in (M) Month
19.Format the current date in (R) RFC1123
20.Format the current date in (s) Sortable
21.Format the current date in (u) Universal sortable
22.Format the current date in (U) Universal full date/time
23.Format the current date in (Y) Year
24.Format a Color enumeration value in (G) General
25.Format a Color enumeration value in (default)
26.Format a Color enumeration value in (F) Flags
27.Format a Color enumeration value in (D) Decimal number
28.Format a Color enumeration value in (X) Hexadecimal
w_ww._ja__v___a2_s_._c__om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.