Name

Decimal

Synopsis

This simple value type is commonly used for financial calculations, which can preserve a significant number of fractional digits with no round-off error. Decimals are stored as 12-byte signed integers scaled by a variable power of 10. This means that a decimal data type can effectively hold 28 significant digits without losing any information. With a scale of 0 (no decimal places), the largest possible value is approximately 7.92x1028. This type is available in VB.NET through the Decimal alias.

Public Structure Decimal : Implements IFormattable, IComparable, IConvertible
' Public Constructors
   Public Sub New( ByVal value As Double) 
   Public Sub New( ByVal value As Integer) 
   Public Sub New( ByVal bits As Integer()) 
   Public Sub New(ByVal lo As Integer, ByVal mid As Integer, 
        ByVal hi As Integer, ByVal isNegative As Boolean, 
        ByVal scale As Byte) 
   Public Sub New( ByVal value As Long) 
   Public Sub New( ByVal value As Single) 
   Public Sub New( ByVal value As UInt32) 
   Public Sub New( ByVal value As UInt64) 
' Public Shared Fields
   Public Shared ReadOnly MaxValue As Decimal                    // =79228162514264337593543950335
   Public Shared ReadOnly MinusOne As Decimal                    // =-1
   Public Shared ReadOnly MinValue As Decimal                    // =-79228162514264337593543950335
   Public Shared ReadOnly One As Decimal                         // =1
   Public Shared ReadOnly Zero As Decimal                        // =0
                  ' Public Shared Methods
   Public Shared Function Add(ByVal d1 As Decimal, 
        ByVal d2 As Decimal) As Decimal  
   Public Shared Function Compare(ByVal d1 As Decimal, ByVal ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.