उदाहरण 1: Decimal मान को UInt64 में बदलना
using System;
public class Demo {
public static void Main() {
Decimal val = 99.29m;
Console.WriteLine("Decimal मान = " + val);
ulong res = Decimal.ToUInt64(val);
Console.WriteLine("64-बिट अनसाइन्ड इंटीजर = " + res);
}
}
आउटपुट
Decimal मान = 99.29
64-बिट अनसाइन्ड इंटीजर = 99
उदाहरण 2: छोटे Decimal मान को बदलना
using System;
public class Demo {
public static void Main() {
Decimal val = 0.001m;
Console.WriteLine("Decimal मान = " + val);
ulong res = Decimal.ToUInt64(val);
Console.WriteLine("64-बिट अनसाइन्ड इंटीजर = " + res);
}
}
आउटपुट
Decimal मान = 0.001
64-बिट अनसाइन्ड इंटीजर = 0