aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/formatReadableSize.cpp
blob: 95441d43b2fcab6fc5d9cf867d40a85c48c97b88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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);
        }
    };
}

REGISTER_FUNCTION(FormatReadableSize)
{
    factory.registerFunction<FunctionFormatReadable<Impl>>();
}

}