lib/duckdb/result.rb in duckdb-0.8.1.2 vs lib/duckdb/result.rb in duckdb-0.8.1.3
- old
+ new
@@ -100,12 +100,10 @@
def _to_decimal(row, col)
BigDecimal(_to_string(row, col))
end
def _to_decimal_internal(row, col)
- lower, upper, _width, scale = __to_decimal_internal(row, col)
- v = (upper * Converter::HALF_HUGEINT + lower).to_s
- v[-scale, 0] = '.' unless v == '0'
- BigDecimal(v)
+ lower, upper, width, scale = __to_decimal_internal(row, col)
+ Converter._to_decimal_from_vector(width, scale, lower, upper)
end
end
end