Set locale.
This commit is contained in:
parent
8331b4211b
commit
6018672106
|
@ -28,6 +28,7 @@
|
|||
#include <functional>
|
||||
#include <future>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
|
@ -171,6 +172,8 @@ 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})",
|
||||
weather.icon, color, weather.temperature,
|
||||
weather.old ? R"( <span color="red">⏳</span>)" : "")
|
||||
|
@ -196,6 +199,7 @@ int main()
|
|||
{
|
||||
try
|
||||
{
|
||||
std::locale::global(std::locale(""));
|
||||
// TODO: Implement clean shutdown.
|
||||
std::atomic<bool> cancelled{false};
|
||||
auto future{
|
||||
|
|
Loading…
Reference in New Issue
Block a user