diff --git a/src/util/format/formatter.cpp b/src/util/format/formatter.cpp index 6b8dd18..ecc7005 100644 --- a/src/util/format/formatter.cpp +++ b/src/util/format/formatter.cpp @@ -47,13 +47,23 @@ void Formatter::format(Builder& builder, size_t value) const template<> void Formatter::format(Builder& builder, float value) const { - builder.putF32(value); + if (specifier.precision < 0) { + builder.putF32(value); + } + else { + builder.putF32(value, specifier.precision); + } } template<> void Formatter::format(Builder& builder, double value) const { - builder.putF64(value); + if (specifier.precision < 0) { + builder.putF64(value); + } + else { + builder.putF64(value, specifier.precision); + } } // Char