the value of decimal columns should return BigDecimal not String
suketa opened this issue · comments
the return value of decimal columns is String object.
db = DuckDB::Database.open
con = db.connect
con.query('CREATE TABLE decimals (decimal_value DECIMAL(30,8))')
con.query("INSERT INTO decimals VALUES (1.23456789)")
result = con.query('SELECT decimal_value FROM decimals')
result.first.first #=> Expected: 1.23456789, But "1.23456789"
Expected value should be Decimal object or Float or String ???
Maybe BigDecimal
?
https://ruby-doc.org/stdlib-3.1.0/libdoc/bigdecimal/rdoc/BigDecimal.html
@sandstrom
Ooops, yes, BigDecimal
not Decimal
Great!