在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
热门推荐
1 狗狗技能训练
5 如何训练狗狗笑
6 狗狗训练排便
9 狗狗响片训练
10 如何训练狗狗不捡食
11 狗狗尿训练
12 怎么训练狗狗找东西
13 狗狗训练站立
14 狗狗训练飞盘
15 鞍山狗狗训练
16 怎样训练泰迪狗狗谢谢
17 狗狗外出训练
18 怎么训练金毛狗狗大小便