Sorry if this is a trivial question. 

I have a table in SQL server thus: 

 CREATE TABLE widgets
 (
   id INT Identity(1, 1) PRIMARY KEY,
   name VARCHAR(12),
   cost MONEY
 )

SELECT * FROM widgets

id          name         cost
----------- ------------ ---------------------
          1 compass                    74.9900
          2 hat                        49.9900
          3 book                       19.9900


and a Widget class 

class Widget < Sequel::Model
end

Contrary to my expectations, Widget.cost has class String'.

Widget[1].cost + Widget[2].cost
=> "74.990049.9900"

 To perform any arithmetics I have to convert 'cost' explicitly to a 
numeric type. I am sure that there is a way to have the model store and 
return a BigDecimal, or another numeric type, but I could not find it.

thank you for your help

Giovanni


-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to