presto-spi/src/main/java/io/prestosql/spi/type/Decimals.java/Decimals/encodeShortScaledValue
class Decimals:    public static long encodeShortScaledValue(BigDecimal value, int scale)
    {
        checkArgument(scale >= 0);
        return value.setScale(scale, UNNECESSARY).unscaledValue().longValueExact();
    }