mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 04:22:03 +00:00
27 lines
479 B
C++
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>>();
|
|
}
|
|
|
|
}
|