Set locale.
This commit is contained in:
parent
8331b4211b
commit
6018672106
|
@ -28,6 +28,7 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <future>
|
#include <future>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <locale>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -171,6 +172,8 @@ void print_weather()
|
||||||
return "#66ff66";
|
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:.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>)" : "")
|
||||||
|
@ -196,6 +199,7 @@ int main()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
std::locale::global(std::locale(""));
|
||||||
// TODO: Implement clean shutdown.
|
// TODO: Implement clean shutdown.
|
||||||
std::atomic<bool> cancelled{false};
|
std::atomic<bool> cancelled{false};
|
||||||
auto future{
|
auto future{
|
||||||
|
|
Loading…
Reference in New Issue