vb System.Decimal.Negate类(方法)实例源码

下面列出了vb System.Decimal.Negate 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:Syste   
' Example of the Decimal.Negate, Decimal.Floor, and Decimal.Truncate 
' methods. 
Module DecimalFloorNegTruncDemo
    
    Const dataFmt As String = "{0,-30}{1,26}"

    ' Display Decimal parameters and their product, quotient, and 
    ' remainder.
    Sub ShowDecimalFloorNegTrunc( Argument as Decimal )

        Console.WriteLine( )
        Console.WriteLine( dataFmt, "Decimal Argument", Argument )
        Console.WriteLine( dataFmt, _
            "Decimal.Negate( Argument )", _
            Decimal.Negate( Argument ) )
        Console.WriteLine( dataFmt, _
            "Decimal.Floor( Argument )", _
            Decimal.Floor( Argument ) )
        Console.WriteLine( dataFmt, _
            "Decimal.Truncate( Argument )", _
            Decimal.Truncate( Argument ) )
    End Sub

    Sub Main( )
        Console.WriteLine( "This example of the " & vbCrLf & _
            "  Decimal.Negate( Decimal ), " & vbCrLf & _
            "  Decimal.Floor( Decimal ), and " & vbCrLf & _
            "  Decimal.Truncate( Decimal ) " & vbCrLf & _
            "methods generates the following output." )

        ' Create pairs of Decimal objects.
        ShowDecimalFloorNegTrunc( 0D ) 
        ShowDecimalFloorNegTrunc( 123.456D ) 
        ShowDecimalFloorNegTrunc( -123.456D ) 
        ShowDecimalFloorNegTrunc( _
            new Decimal( 1230000000, 0, 0, True, 7 ) )
        ShowDecimalFloorNegTrunc( -9999999999.9999999999D )
    End Sub
End Module 

' This example of the
'   Decimal.Negate( Decimal ),
'   Decimal.Floor( Decimal ), and
'   Decimal.Truncate( Decimal )


问题


面经


文章

微信
公众号

扫码关注公众号