```sql
SELECT
    floor(toDecimal64(1232.123132, 4) AS D64),
    ceiling(D64),
    round(D64),
    roundBankers(D64),
    floor(toDecimal128(1232.123132, 24) AS D128),
    ceiling(D128),
    round(D128),
    roundBankers(D128),
    floor(toDecimal256(1232.123132, 24) AS D256),
    ceiling(D256),
    round(D256),
    roundBankers(D256)
FORMAT Vertical

Query id: 04db8c13-4888-47b6-908b-ba1268138f26

Row 1:
──────
floor(toDecimal64(1232.123132, 4)):          1232
ceil(toDecimal64(1232.123132, 4)):           1233
round(toDecimal64(1232.123132, 4)):          1232
roundBankers(toDecimal64(1232.123132, 4)):   1232
floor(toDecimal128(1232.123132, 24)):        1232.12311679615299966394772
ceil(toDecimal128(1232.123132, 24)):         1232.123135242897073373499335
round(toDecimal128(1232.123132, 24)):        1232.123135242897073373499335
roundBankers(toDecimal128(1232.123132, 24)): 1232.123135242897073373499335
floor(toDecimal256(1232.123132, 24)):        1232.12311679615299966394772
ceil(toDecimal256(1232.123132, 24)):         1232.123135242897073373499335
round(toDecimal256(1232.123132, 24)):        1232.123135242897073373499335
roundBankers(toDecimal256(1232.123132, 24)): 1232.123135242897073373499335
```

{
        if (arguments.size() == 2)
        {
            const IColumn & scale_column = *arguments[1].column;
            if (!isColumnConst(scale_column))
                throw Exception("Scale argument for rounding functions must be constant", ErrorCodes::ILLEGAL_COLUMN);
            Field scale_field = assert_cast<const ColumnConst &>(scale_column).getField();
            if (scale_field.getType() != Field::Types::UInt64
                && scale_field.getType() != Field::Types::Int64)
                throw Exception("Scale argument for rounding functions must have integer type", ErrorCodes::ILLEGAL_COLUMN);
            Int64 scale64 = scale_field.get<Int64>();
            if (scale64 > std::numeric_limits<Scale>::max()
                || scale64 < std::numeric_limits<Scale>::min())
                throw Exception("Scale argument for rounding function is too large", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
            return scale64;
        }
        return 0;
    }
    bool useDefaultImplementationForConstants() const override { return true; }