本文整理匯總了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