mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +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>>();
|
|
}
|
|
|
|
}
|