C# Convert ToSByte(Double)
Description
Convert ToSByte(Double)
converts the value of the specified
double-precision floating-point number to an equivalent 8-bit signed
integer.
Syntax
Convert.ToSByte(Double)
has the following syntax.
[CLSCompliantAttribute(false)]
public static sbyte ToSByte(
double value
)
Parameters
Convert.ToSByte(Double)
has the following parameters.
value
- The double-precision floating-point number to convert.
Returns
Convert.ToSByte(Double)
method returns value, rounded to the nearest 8-bit signed integer. If value is halfway between
two whole numbers, the even number is returned; that is, 4.5 is converted
to 4, and 5.5 is converted to 6.
Example
//from www .j av a2s . c o m
using System;
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Convert.ToSByte(123.123D));
}
}
The code above generates the following result.