当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET Decimal.Multiply方法代码示例

本文整理汇总了VB.NET中System.Decimal.Multiply方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Decimal.Multiply方法的具体用法?VB.NET Decimal.Multiply怎么用?VB.NET Decimal.Multiply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Decimal的用法示例。


在下文中一共展示了Decimal.Multiply方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: DecimalMulDivRemDemo

Module DecimalMulDivRemDemo
    Const dataFmt As String = "{0,-35}{1,31}"

    ' Display Decimal parameters and their product, quotient, and 
    ' remainder.
    Sub ShowDecimalProQuoRem(left as Decimal, right as Decimal)
        Console.WriteLine()
        Console.WriteLine(dataFmt, "Decimal left", left )
        Console.WriteLine( dataFmt, "Decimal right", right )
        Console.WriteLine( dataFmt, 
            "Decimal.Multiply( left, right )", 
            Decimal.Multiply( left, right ) )
        Console.WriteLine( dataFmt, 
            "Decimal.Divide( left, right )", 
            Decimal.Divide( left, right ) )
        Console.WriteLine( dataFmt, 
            "Decimal.Remainder( left, right )", 
            Decimal.Remainder( left, right ) )
    End Sub

    Sub Main( )
        Console.WriteLine( "This example of the " & vbCrLf & 
            "  Decimal.Multiply( Decimal, Decimal ), " & vbCrLf & 
            "  Decimal.Divide( Decimal, Decimal ), and " & vbCrLf & 
            "  Decimal.Remainder( Decimal, Decimal ) " & vbCrLf & 
            "methods generates the following output. It displays " & 
            "the product, " & vbCrLf & "quotient, and remainder " & 
            "of several pairs of Decimal objects." )

        ' Create pairs of Decimal objects.
        ShowDecimalProQuoRem( 1000D, 7D ) 
        ShowDecimalProQuoRem( -1000D, 7D ) 
        ShowDecimalProQuoRem( 
            new Decimal( 1230000000, 0, 0, False, 7 ), 
            0.0012300D )
        ShowDecimalProQuoRem( 12345678900000000D, 
            0.0000000012345678D )
        ShowDecimalProQuoRem( 123456789.0123456789D, 
            123456789.1123456789D )
    End Sub
End Module 

' This example of the
'   Decimal.Multiply( Decimal, Decimal ),
'   Decimal.Divide( Decimal, Decimal ), and
'   Decimal.Remainder( Decimal, Decimal )
' methods generates the following output. It displays the product,
' quotient, and remainder of several pairs of Decimal objects.
' 
' Decimal left                                                  1000
' Decimal right                                                    7
' Decimal.Multiply( left, right )                               7000
' Decimal.Divide( left, right )       142.85714285714285714285714286
' Decimal.Remainder( left, right )                                 6
' 
' Decimal left                                                 -1000
' Decimal right                                                    7
' Decimal.Multiply( left, right )                              -7000
' Decimal.Divide( left, right )      -142.85714285714285714285714286
' Decimal.Remainder( left, right )                                -6
' 
' Decimal left                                           123.0000000
' Decimal right                                              0.00123
' Decimal.Multiply( left, right )                     0.151290000000
' Decimal.Divide( left, right )                            100000.00
' Decimal.Remainder( left, right )                                 0
' 
' Decimal left                                     12345678900000000
' Decimal right                                   0.0000000012345678
' Decimal.Multiply( left, right )          15241577.6390794200000000
' Decimal.Divide( left, right )       10000000729000059778004901.796
' Decimal.Remainder( left, right )                    0.000000000983
' 
' Decimal left                                  123456789.0123456789
' Decimal right                                 123456789.1123456789
' Decimal.Multiply( left, right )     15241578765584515.651425087878
' Decimal.Divide( left, right )       0.9999999991899999933660999449
' Decimal.Remainder( left, right )              123456789.0123456789
开发者ID:VB.NET开发者,项目名称:System,代码行数:78,代码来源:Decimal.Multiply


注:本文中的System.Decimal.Multiply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。