On Sep 1, 2010, at 15:14 , Jeremy Evans wrote:

> Note the part about "here is no simple way of doing the reverse in a
> locale-independent manner, namely casting a money value to a numeric
> type."

Yup, I knew about that.

> Now, you could try:
> 
>  Sequel::Postgres::PG_TYPES[790] = lambda{|v|
> BigDecimal.new(v[1..-1])}
> 
> Assuming that you are in a locale where money is displayed as $DD.DD,
> that should work.
> 
> If you have any control over the schema, use a numeric type such as
> numeric(10,2) instead of money.

I found myself wondering what the purpose of the "money" type is in the first 
place, if it's so difficult to work with. 

And the answer appears to be "it doesn't have one." It appears to be 
unofficially deprecated. 

numeric(10,2) it is. 

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to