statusweather: Use correct decimal separator.

Needs >=libfmt-8
This commit is contained in:
tastytea 2021-08-23 20:53:03 +02:00
parent 6018672106
commit ba720840a8
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 2 additions and 4 deletions

View File

@ -11,7 +11,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
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(nlohmann_json 3 REQUIRED CONFIG)
find_package(Threads REQUIRED)

View File

@ -172,9 +172,7 @@ void print_weather()
return "#66ff66";
}()};
// NOTE: It is not possible to use local decimal separators and specify how
// many digits should be displayed after the separator. 🙁
std::cout << format(R"({0:s} <span color="{1:s}">{2:.1f}°C</span>{3:s})",
std::cout << format(R"({0:s} <span color="{1:s}">{2:.1Lf}°C</span>{3:s})",
weather.icon, color, weather.temperature,
weather.old ? R"( <span color="red">⏳</span>)" : "")
<< std::endl;