ClickHouse/src/Functions/formatReadableSize.cpp
2020-10-10 21:23:54 +03:00

27 lines
479 B
C++

#include <Functions/FunctionFactory.h>
#include <Functions/formatReadable.h>
namespace DB
{
namespace
{
struct Impl
{
static constexpr auto name = "formatReadableSize";
static void format(double value, DB::WriteBuffer & out)
{
formatReadableSizeWithBinarySuffix(value, out);
}
};
}
void registerFunctionFormatReadableSize(FunctionFactory & factory)
{
factory.registerFunction<FunctionFormatReadable<Impl>>();
}
}