1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-05 16:43:52 +01:00

Bug 2241 - Spectral Selection Toolbar displays frequencies 100x too small in some languages

This commit is contained in:
James Crook
2020-04-20 23:35:10 +01:00
parent 0e2fd0ec35
commit 0a95de6c06

View File

@@ -733,6 +733,8 @@ void NumericConverter::ParseFormatString(
if (format[i] == '|') {
wxString remainder = format.Right(format.length() - i - 1);
// For languages which use , as a separator.
remainder.Replace(wxT(","), wxT("."));
if (remainder == wxT("#"))
mScalingFactor = mSampleRate;
@@ -740,7 +742,7 @@ void NumericConverter::ParseFormatString(
mNtscDrop = true;
}
else
remainder.ToDouble(&mScalingFactor);
remainder.ToCDouble(&mScalingFactor);
i = format.length()-1; // force break out of loop
if (!delimStr.empty())
handleDelim = true;
@@ -805,6 +807,13 @@ void NumericConverter::ParseFormatString(
if (delimStr.length() > 1)
delimStr = delimStr.BeforeLast('.');
}
// Bug 2241 - Also handle , as decimal point
// for languages like French and German.
else if (!inFrac && delimStr[delimStr.length()-1]==',') {
goToFrac = true;
if (delimStr.length() > 1)
delimStr = delimStr.BeforeLast(',');
}
if (inFrac) {
if (numFracFields == 0) {