C# Convert ToDecimal(Decimal)
Description
Convert ToDecimal(Decimal)
returns the specified decimal
number; no actual conversion is performed.
Syntax
Convert.ToDecimal(Decimal)
has the following syntax.
public static decimal ToDecimal(
decimal value
)
Parameters
Convert.ToDecimal(Decimal)
has the following parameters.
value
- A decimal number.
Returns
Convert.ToDecimal(Decimal)
method returns value is returned unchanged.
Example
//from w ww. j av a2 s. co m
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToDecimal(1.2M));
}
}
The code above generates the following result.