本文整理匯總了VB.NET中System.Globalization.NumberFormatInfo.NumberNegativePattern屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET NumberFormatInfo.NumberNegativePattern屬性的具體用法?VB.NET NumberFormatInfo.NumberNegativePattern怎麽用?VB.NET NumberFormatInfo.NumberNegativePattern使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Globalization.NumberFormatInfo
的用法示例。
在下文中一共展示了NumberFormatInfo.NumberNegativePattern屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.Globalization
Module Example
Public Sub Main()
' Creates a new NumberFormatinfo.
Dim nfi As New NumberFormatInfo()
' Define a negative value.
Dim value As Int64 = -1234
' Display the value with default formatting.
Console.WriteLine("{0,-20} {1,-10}", "Default:",
value.ToString("N", nfi))
' Display the value with other patterns.
For i As Integer = 0 To 4
nfi.NumberNegativePattern = i
Console.WriteLine("{0,-20} {1,-10}",
String.Format("Pattern {0}:",
nfi.NumberNegativePattern),
value.ToString("N", nfi))
Next
End Sub
End Module
輸出:
Default: -1,234.00 Pattern 0: (1,234.00) Pattern 1: -1,234.00 Pattern 2: - 1,234.00 Pattern 3: 1,234.00- Pattern 4: 1,234.00 -