statusweather: Use correct decimal separator.
Needs >=libfmt-8
This commit is contained in:
parent
6018672106
commit
ba720840a8
|
@ -11,7 +11,7 @@ set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
find_package(fmt 7 REQUIRED CONFIG)
|
find_package(fmt 8 REQUIRED CONFIG)
|
||||||
find_package(restclient-cpp 0.5 REQUIRED CONFIG)
|
find_package(restclient-cpp 0.5 REQUIRED CONFIG)
|
||||||
find_package(nlohmann_json 3 REQUIRED CONFIG)
|
find_package(nlohmann_json 3 REQUIRED CONFIG)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
|
@ -172,9 +172,7 @@ void print_weather()
|
||||||
return "#66ff66";
|
return "#66ff66";
|
||||||
}()};
|
}()};
|
||||||
|
|
||||||
// NOTE: It is not possible to use local decimal separators and specify how
|
std::cout << format(R"({0:s} <span color="{1:s}">{2:.1Lf}°C</span>{3:s})",
|
||||||
// many digits should be displayed after the separator. 🙁
|
|
||||||
std::cout << format(R"({0:s} <span color="{1:s}">{2:.1f}°C</span>{3:s})",
|
|
||||||
weather.icon, color, weather.temperature,
|
weather.icon, color, weather.temperature,
|
||||||
weather.old ? R"( <span color="red">⏳</span>)" : "")
|
weather.old ? R"( <span color="red">⏳</span>)" : "")
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
Loading…
Reference in New Issue