I'm loading floats from an XML document.
For example from the following line:
<Attack name="Sword Slash" damage="10.0" stat="Strength" multiplier="2.0" />
If I read this and then parse it to a float, the damage is 100 instead of 10.0, and the multiplier is 20 instead of 2.0 aswell. I think this is because of problems with CultureInfo (not sure on this).
I tried fixing it by changing the line that reads the data from:
this.damage = float.Parse(reader.Value);
To:
this.damage = float.Parse(reader.Value.ToString(CultureInfo.CreateSpecificCulture("en-US")));
However, this does not seem to fix anything.
Any solution?