Int to Decimal Conversion - Insert decimal point at specified location

Baxter picture Baxter · Apr 6, 2012 · Viewed 105.7k times · Source

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?

Answer

Bala R picture Bala R · Apr 6, 2012
int i = 7122960;
decimal d = (decimal)i / 100;