本文整理汇总了VB.NET中System.Decimal.Divide方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Decimal.Divide方法的具体用法?VB.NET Decimal.Divide怎么用?VB.NET Decimal.Divide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Decimal
的用法示例。
在下文中一共展示了Decimal.Divide方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Example
Module Example
Public Sub Main()
' Divide a series of numbers by 22.1
Dim dividend As Decimal = 1230.0d
Dim divisor As Decimal = 22.1d
For ctr As Integer = 0 To 10
Console.WriteLine("{0:N1} / {1:N1} = {2:N4}", dividend, divisor,
Decimal.Divide(dividend, divisor))
dividend += .1d
Next
End Sub
End Module
输出:
1,230.0 / 22.1 = 55.6561 1,230.1 / 22.1 = 55.6606 1,230.2 / 22.1 = 55.6652 1,230.3 / 22.1 = 55.6697 1,230.4 / 22.1 = 55.6742 1,230.5 / 22.1 = 55.6787 1,230.6 / 22.1 = 55.6833 1,230.7 / 22.1 = 55.6878 1,230.8 / 22.1 = 55.6923 1,230.9 / 22.1 = 55.6968 1,231.0 / 22.1 = 55.7014
示例2: Test
public class Test
public Shared Sub Main
Dim D1, D2 As Decimal
D1 = 10
D2 = 5.7
Console.WriteLine(Decimal.Divide(D1, D2))
End Sub
End class