Implicit conversion from 32-bit unsigned integer (UInt) to Decimal in C#


Implicit conversion of a 32-bit unsigned integer (UInt) to a Decimal requires you to first declare a UInt.

uint val = 342741539;

Now to convert it to decimal, just assign the value.

decimal dec;
// implicit
dec = val;

Example

 Live Demo

using System;
public class Demo {
   public static void Main() {
      uint val = 342741539;
      decimal dec;
      // implicit
      dec = val;
      Console.WriteLine("Decimal = "+dec);
   }
}

Output

Decimal = 342741539

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 23-Jun-2020

648 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements