C# Decimal Multiply
Description
Decimal Multiply
multiplies two specified Decimal values.
Syntax
Decimal.Multiply
has the following syntax.
public static decimal operator *(
decimal d1,
decimal d2
)
Parameters
Decimal.Multiply
has the following parameters.
d1
- The first value to multiply.d2
- The second value to multiply.
Returns
Decimal.Multiply
method returns The result of multiplying d1 by d2.
Example
The Multiply method defines the operation of the multiplication operator for Decimal values. It enables code such as the following:
using System;/* w w w . ja v a2 s .co m*/
public class Example
{
public static void Main()
{
Decimal number1 = 16.8m;
Decimal number2 = 4.1m;
Decimal number3 = number1 * number2;
Console.WriteLine(number3);
}
}
The code above generates the following result.