diff --git a/include/spdlog/details/pattern_formatter-inl.h b/include/spdlog/details/pattern_formatter-inl.h index f4e406a5..cc2f7eaa 100644 --- a/include/spdlog/details/pattern_formatter-inl.h +++ b/include/spdlog/details/pattern_formatter-inl.h @@ -875,8 +875,10 @@ public: auto delta = (std::max)(msg.time - last_message_time_, log_clock::duration::zero()); auto delta_units = std::chrono::duration_cast(delta); last_message_time_ = msg.time; - ScopedPadder p(6, padinfo_, dest); - fmt_helper::pad6(static_cast(delta_units.count()), dest); + auto delta_count = static_cast(delta_units.count()); + auto n_digits = static_cast(fmt_helper::count_digits(delta_count)); + ScopedPadder p(n_digits, padinfo_, dest); + fmt_helper::append_int(delta_count, dest); } private: