I have in my app.config
the following code:
<add key="FolhaA4" value="0.168056514197457, 6.36413684210526"/>
And here's the method to get these key values:
private double[] ObterValoresConfiguracao(string chave)
{
Manager.Configuration config = Manager.ConfigurationManager.OpenExeConfiguration(this.GetType().Assembly.Location);
Manager.AppSettingsSection app = (Manager.AppSettingsSection)config.GetSection("appSettings");
string[] valor = app.Settings[chave].Value.Split(',');
return valor.Select(i => Convert.ToDouble(i)).ToArray();
}
I'm retrieving them as string and converting to double
, but I need these values to be doubles
the same as they are, and the conversion is returning totally different values.
Ex: 6.36413684210526
converts to - > 6364136842105.26
Does anyone know why this is so? how do I convert the number to double
that it stays the same?