本文整理匯總了VB.NET中System.Decimal.MaxValue字段的典型用法代碼示例。如果您正苦於以下問題:VB.NET Decimal.MaxValue字段的具體用法?VB.NET Decimal.MaxValue怎麽用?VB.NET Decimal.MaxValue使用的例子?那麽, 這裏精選的字段代碼示例或許可以為您提供幫助。您也可以進一步了解該字段所在類System.Decimal
的用法示例。
在下文中一共展示了Decimal.MaxValue字段的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: PiggyBank
Class PiggyBank
Public ReadOnly Property Capacity() As Decimal
Get
Return [Decimal].MaxValue
End Get
End Property
Protected MyFortune As Decimal
Public Sub AddPenny()
MyFortune += 0.01D
End Sub
End Class
示例2: Tester
Public Class Tester
Public Shared Sub Main
Dim result As New System.Text.StringBuilder
Dim maxDecimal As Decimal = Decimal.MaxValue
Dim sizeOfDecimal As Integer = Runtime.InteropServices.Marshal.SizeOf(maxDecimal.GetType)
result.Append("Memory size of a Decimal (bytes): ")
result.AppendLine(sizeOfDecimal)
result.Append("Maximum value of a Decimal: ")
result.AppendLine(maxDecimal)
result.Append("Divided by one million: ")
result.AppendLine(maxDecimal / 1000000D)
result.Append("1D / 3D: ")
result.AppendLine(1D / 3D)
Console.WriteLine(result.ToString())
End Sub
End Class