Assume Mhz if input <= 3000 with no suffix, require suffix of 'hz' below 3001hz

This commit is contained in:
Charles J. Cliffe 2015-07-06 23:15:18 -04:00
parent 6fe145425c
commit c728ddc45b
1 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,7 @@ std::string FrequencyDialog::frequencyToStr(long long freq) {
}
long long FrequencyDialog::strToFrequency(std::string freqStr) {
std::string filterStr = filterChars(freqStr, std::string("0123456789.MKGmkg"));
std::string filterStr = filterChars(freqStr, std::string("0123456789.MKGHmkgh"));
int numLen = filterStr.find_first_not_of("0123456789.");
@ -90,8 +90,10 @@ long long FrequencyDialog::strToFrequency(std::string freqStr) {
freqTemp *= 1.0e6;
} else if (suffixStr.find_first_of("Kk") != std::string::npos) {
freqTemp *= 1.0e3;
} else if (suffixStr.find_first_of("Hh") != std::string::npos) {
// ...
}
} else if (numPartStr.find_first_of(".") != std::string::npos) {
} else if (numPartStr.find_first_of(".") != std::string::npos || freqTemp <= 3000) {
freqTemp *= 1.0e6;
}