From 02fc49bd513d2e2e6a3fd6121dc849ffea19c82a Mon Sep 17 00:00:00 2001 From: Rasmus Skovgaard Andersen Date: Thu, 5 Sep 2024 16:29:32 +0200 Subject: [PATCH] Fix: "Human readable time" now shows milliseconds correctly. --- src/log_database_proxy_model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log_database_proxy_model.cpp b/src/log_database_proxy_model.cpp index 1dd6ed9..8348205 100644 --- a/src/log_database_proxy_model.cpp +++ b/src/log_database_proxy_model.cpp @@ -429,7 +429,7 @@ QVariant LogDatabaseProxyModel::data( if (human_readable_time_) { char date_str[std::size("yyyy-mm-dd hh:mm:ss")]; const time_t time = static_cast(item.stamp.seconds()); - int32_t milliseconds = static_cast(1000.0 * (item.stamp.seconds() - static_cast(item.stamp.seconds()))); + int32_t milliseconds = static_cast(1000.0 * (item.stamp.seconds() - std::floor(item.stamp.seconds()))); std::strftime(std::data(date_str), std::size(date_str), "%F %T",