I'm reading a text file from bank with a string of numbers. 0000000010050
, the amount of this string is $ 100.50, but is there a way to insert a decimal point in the string? here is my code.
string amount = 0000000010050;
string f_amount = "";
string ff_amount = "";
decimal d_amount = 0;
f_amount = amount.Trim();
d_amount = int.Parse(f_amount.TrimStart('0')); // this part removes the zeros and the output is 10050.
ff_amount = string.Format("{0:0,0.00}", d_amount); // this line outputs 10050.00
how to make the output looks like this 100.50
?