A fiddle you can see the results (there is a culture problem here too)
https://dotnetfiddle.net/Lnv1q7
string amount_in_string = "1234567,15"; // NOTE THE COMMA in original
string amount_in_string = "1234567.15"; //my correct culture
double amount_in_double = double.Parse(amount_in_string);
float amount_in_float = float.Parse(amount_in_string);
Console.WriteLine(amount_in_string);
Console.WriteLine(amount_in_double);
Console.WriteLine(amount_in_float);
Results (parsing in the incorrect culture!)
1234567,15
123456715
1.234567E+08
Results (parsing in the correct culture!)
1234567.15
1234567.15
1234567
Another one that demonstrates the loss of precision with float
float flt = 1F/3;
double dbl = 1D/3;
decimal dcm = 1M/3;
Console.WriteLine("float: {0} double: {1} decimal: {2}", flt, dbl, dcm);
Result
float: 0.3333333
double: 0.333333333333333
decimal: 0.3333333333333333333333333333
floats should only be used in cases were some loss of precision is not extremely valuable. This is because floats are 32bit where decimal is 128 bit
floats are mainly used in pixel coordinates, and loss of precision doesn't matter because a the consumer translates locations to more precise coordinates any way.
in .NET floats "should" be actively avoided unless you don't care about loss of (some) precision. Which is probably never now a days (unless you writting games)
This is where the banking problem came from when 100th's of a penny/cent across transactions where lost, seemingly invisible per transaction but amounting to large amounts of "missing" money.
Use decimal