Util: Pass floating-point precision to Format::Builder
This commit is contained in:
@@ -47,14 +47,24 @@ 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user