From ba720840a8a5c6cdfd4ba3d2f30d5ebaa1a9f98d Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 23 Aug 2021 20:53:03 +0200 Subject: [PATCH] statusweather: Use correct decimal separator. Needs >=libfmt-8 --- CMakeLists.txt | 2 +- statusweather.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dfce06..211cf9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/statusweather.cpp b/statusweather.cpp index d9e639a..43056b7 100644 --- a/statusweather.cpp +++ b/statusweather.cpp @@ -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} {2:.1f}°C{3:s})", + std::cout << format(R"({0:s} {2:.1Lf}°C{3:s})", weather.icon, color, weather.temperature, weather.old ? R"( )" : "") << std::endl;