diff --git a/USER_MANUAL.html b/USER_MANUAL.html index 56d2423b..74d55336 100644 --- a/USER_MANUAL.html +++ b/USER_MANUAL.html @@ -657,6 +657,7 @@ FMA - Supports FMA extensions using YMM state
  • Enhancements: diff --git a/USER_MANUAL.md b/USER_MANUAL.md index 35c0498f..e910b543 100644 --- a/USER_MANUAL.md +++ b/USER_MANUAL.md @@ -917,6 +917,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes 1. Bugfixes: * Fix bug preventing frequency updates from being properly suppressed when frequency control is in focus. (PR #585) * Fix bug preventing 60 meter frequencies from using USB with DIGU/DIGL disabled. (PR #589) + * Additional fix for PR #561 to parse/format frequencies using current locale. (PR #595) * Add entitlements to work around macOS Sonoma permissions bug. (PR #598) * Fix bug preventing FreeDV Reporter window from closing after resetting configuration to defaults. (PR #593) 2. Enhancements: diff --git a/USER_MANUAL.pdf b/USER_MANUAL.pdf index c878e67a..75149e6e 100644 Binary files a/USER_MANUAL.pdf and b/USER_MANUAL.pdf differ diff --git a/src/ongui.cpp b/src/ongui.cpp index 5fcc20f4..d005211f 100644 --- a/src/ongui.cpp +++ b/src/ongui.cpp @@ -4,6 +4,10 @@ The simpler GUI event handlers. */ +#include +#include +#include + #include "main.h" #include "lpcnet_freedv.h" @@ -419,7 +423,12 @@ bool MainFrame::OpenHamlibRig() { !wxGetApp().appConfiguration.reportingConfiguration.reportingEnabled || !wxGetApp().appConfiguration.reportingConfiguration.manualFrequencyReporting)) { - m_cboReportFrequency->SetValue(wxString::Format("%.4f", freq/1000.0/1000.0)); + // wxString::Format() doesn't respect locale but C++ iomanip should. Use the latter instead. + std::stringstream ss; + std::locale loc(""); + ss.imbue(loc); + ss << std::fixed << std::setprecision(4) << (freq / 1000.0 / 1000.0); + m_cboReportFrequency->SetValue(ss.str()); } m_txtModeStatus->Refresh(); }); @@ -995,7 +1004,14 @@ void MainFrame::OnChangeReportFrequency( wxCommandEvent& event ) if (freqStr.Length() > 0) { - wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency = round(atof(freqStr.ToUTF8()) * 1000 * 1000); + double tmp = 0; + std::stringstream ss(std::string(freqStr.ToUTF8())); + std::locale loc(""); + ss.imbue(loc); + + ss >> std::fixed >> std::setprecision(4) >> tmp; + + wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency = round(tmp * 1000 * 1000); if (wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency > 0) { m_cboReportFrequency->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));