Browse Source

Util: Pass floating-point precision to Format::Builder

master
Riyyi 2 years ago
parent
commit
6209251ca6
  1. 10
      src/util/format/formatter.cpp

10
src/util/format/formatter.cpp

@ -47,13 +47,23 @@ void Formatter<size_t>::format(Builder& builder, size_t value) const
template<>
void Formatter<float>::format(Builder& builder, float value) const
{
if (specifier.precision < 0) {
builder.putF32(value);
}
else {
builder.putF32(value, specifier.precision);
}
}
template<>
void Formatter<double>::format(Builder& builder, double value) const
{
if (specifier.precision < 0) {
builder.putF64(value);
}
else {
builder.putF64(value, specifier.precision);
}
}
// Char

Loading…
Cancel
Save