mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-06 10:47:34 +01:00
fix frequency formatting when copying from frequency selector
This commit is contained in:
parent
1cbc8ec6f5
commit
fbbafddd3d
@ -28,10 +28,14 @@ namespace hrfreq {
|
|||||||
char numBuf[128];
|
char numBuf[128];
|
||||||
int numLen = sprintf(numBuf, "%0.*lf", maxDecimals, freq);
|
int numLen = sprintf(numBuf, "%0.*lf", maxDecimals, freq);
|
||||||
|
|
||||||
// Remove the useless zeros
|
// If there is a decimal point, remove the useless zeros
|
||||||
for (int i = numLen-1; i >= 0; i--) {
|
if (maxDecimals) {
|
||||||
if (numBuf[i] != '0' && numBuf[i] != '.') { break; }
|
for (int i = numLen-1; i >= 0; i--) {
|
||||||
numBuf[i] = 0;
|
bool dot = (numBuf[i] == '.');
|
||||||
|
if (numBuf[i] != '0' && !dot) { break; }
|
||||||
|
numBuf[i] = 0;
|
||||||
|
if (dot) { break; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Concat the suffix
|
// Concat the suffix
|
||||||
|
Loading…
Reference in New Issue
Block a user