在C#中从64位带符号整数(长整数)到十进制的隐式转换
long类型表示64位有符号整数。
若要将64位带符号整数隐式转换为Decimal,请首先设置一个long值。
long val = 989678876876876;
要将long转换为十进制,请分配值。
dec = val;
让我们看另一个例子-
示例
using System;
public class Demo {
public static void Main() {
long val = 76755565656565;
decimal dec;
Console.WriteLine("Implicit conversion from 64-bit signed integer (long) to Decimal");
dec = val;
Console.WriteLine("Decimal : "+dec);
}
}输出结果
Implicit conversion from 64-bit signed integer (long) to Decimal Decimal : 76755565656565
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短