Search code examples
c#intdecimaltype-conversiondecimal-point

Int to Decimal Conversion - Insert decimal point at specified location


I have the following int 7122960
I need to convert it to 71229.60

Any ideas on how to convert the int into a decimal and insert the decimal point in the correct location?


Solution

  • int i = 7122960;
    decimal d = (decimal)i / 100;