public static void writeDecimal32(OutputStream output, BigDecimal value, int scale) throws IOException {
        writeInt32(output,
                ClickHouseChecker.between(
                        value.multiply(BigDecimal.TEN.pow(ClickHouseChecker.between(scale, ClickHouseValues.PARAM_SCALE,
                                0, ClickHouseDataType.Decimal32.getMaxScale()))),
                        ClickHouseValues.TYPE_BIG_DECIMAL, DECIMAL32_MIN, DECIMAL32_MAX).intValue());
    }
Write a big decimal(4 bytes) to given output stream.

@param output non-null output stream
@param value  big decimal
@param scale  scale of the decimal, might be different from
              {@link java.math.BigDecimal#scale()}
@throws IOException when failed to write value to output stream or reached
                    end of the stream
clickhouse-data/src/main/java/com/clickhouse/data/format/BinaryStreamUtils.java