diff --git a/fmt/format.h b/fmt/format.h index a42e29f8..788ec7cf 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -2832,7 +2832,8 @@ void BasicWriter::write_int(T value, Spec spec) { case 'n': { unsigned num_digits = internal::count_digits(abs_value); fmt::StringRef sep = std::localeconv()->thousands_sep; - std::size_t size = num_digits + sep.size() * (num_digits - 1) / 3; + unsigned size = static_cast( + num_digits + sep.size() * (num_digits - 1) / 3); CharPtr p = prepare_int_buffer(size, spec, prefix, prefix_size) + 1; internal::format_decimal(get(p), abs_value, 0, internal::ThousandsSep(sep)); break;