Loading common/projet_config.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,18 @@ #define FORCE_LOCAL_CONFIG true void ConfigBaseWriteDouble( wxConfigBase* aConfig, const wxString& aKey, double aValue ) { // Use a single strategy, regardless of wx version. // Want C locale float string. LOCALE_IO toggle; wxString tnumber = wxString::Format( wxT( "%.16g" ), aValue ); aConfig->Write( aKey, tnumber ); } bool EDA_APP::ReCreatePrjConfig( const wxString& fileName, const wxString& GroupName, bool ForceUseLocalConfig ) Loading include/param_config.h +3 −17 Original line number Diff line number Diff line Loading @@ -15,28 +15,14 @@ /** * inline ConfigBaseWriteDouble * This is a helper funvtion tor write doubles in config * Function ConfigBaseWriteDouble * This is a helper function to write doubles in config * We cannot use wxConfigBase->Write for a double, because * this function uses a format with very few digits in mantissa, * and truncation issues are frequent. * We use here a better floating format. * * Note: prior to 2.9.1, the separator was localized, and after, uses * the "C" notation */ void inline ConfigBaseWriteDouble( wxConfigBase* aConfig, const wxString& aKey, double aValue ) { wxString tnumber; #if wxCHECK_VERSION(2,9,1) tnumber = wxString::FromCDouble( aValue, 12 ); #else tnumber.Printf( wxT("%12f"), aValue ); #endif aConfig->Write( aKey, tnumber ); } void ConfigBaseWriteDouble( wxConfigBase* aConfig, const wxString& aKey, double aValue ); /** Type of parameter in the configuration file */ Loading Loading
common/projet_config.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,18 @@ #define FORCE_LOCAL_CONFIG true void ConfigBaseWriteDouble( wxConfigBase* aConfig, const wxString& aKey, double aValue ) { // Use a single strategy, regardless of wx version. // Want C locale float string. LOCALE_IO toggle; wxString tnumber = wxString::Format( wxT( "%.16g" ), aValue ); aConfig->Write( aKey, tnumber ); } bool EDA_APP::ReCreatePrjConfig( const wxString& fileName, const wxString& GroupName, bool ForceUseLocalConfig ) Loading
include/param_config.h +3 −17 Original line number Diff line number Diff line Loading @@ -15,28 +15,14 @@ /** * inline ConfigBaseWriteDouble * This is a helper funvtion tor write doubles in config * Function ConfigBaseWriteDouble * This is a helper function to write doubles in config * We cannot use wxConfigBase->Write for a double, because * this function uses a format with very few digits in mantissa, * and truncation issues are frequent. * We use here a better floating format. * * Note: prior to 2.9.1, the separator was localized, and after, uses * the "C" notation */ void inline ConfigBaseWriteDouble( wxConfigBase* aConfig, const wxString& aKey, double aValue ) { wxString tnumber; #if wxCHECK_VERSION(2,9,1) tnumber = wxString::FromCDouble( aValue, 12 ); #else tnumber.Printf( wxT("%12f"), aValue ); #endif aConfig->Write( aKey, tnumber ); } void ConfigBaseWriteDouble( wxConfigBase* aConfig, const wxString& aKey, double aValue ); /** Type of parameter in the configuration file */ Loading