Closed kfb77 closed 8 months ago
Hi kfb77,
i would include this one as
auto PrintFloat = [](float& f) -> std::string {
char buf[32];
snprintf(buf, sizeof(buf), "%.3f", f);
std::string s((const char *) buf);
ReplaceAll(s, ",", ".");
return s;
};
Also, i would add a line into HISTORY.
Some small test program to confirm, use
g++ -Wall -Wextra test.cpp -o testme -lrepfunc
#include <iostream>
#include <clocale>
#include <repfunc.h>
int main() {
auto PrintFloat = [](float& f) -> std::string {
char buf[32];
snprintf(buf, sizeof(buf), "%.3f", f);
std::string s((const char *) buf);
ReplaceAll(s, ",", ".");
return s;
};
std::setlocale(LC_NUMERIC, "de_DE.UTF-8");
float f = 400.33;
std::cout << PrintFloat(f) << std::endl;
return 0;
}
I have testet it with the current code from branch "wirbel" and no problems so far. Thx. I close the PR.
I found the issue described here. The OctopusNet does not accept a ',' in the freqency field from the setup request. Here the output from a trace from the setup request: Request: SETUP rtsp://10.1.15.217/?src=1&freq=10714,000&pol=h&ro=0.35&msys=dvbs2&mtype=8psk&sr=22000&fec=23 RTSP/1.0\r\n The issue only occurs on system with ',' as separator in float values.