Skip site navigation (1) Skip section navigation (2)

Re: Integer Question - Does Limit Value Make Sense

From: <operationsengineer1(at)yahoo(dot)com>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Integer Question - Does Limit Value Make Sense
Date: 2006-11-26 06:43:50
Message-ID: 255979.4072.qm@web33308.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
--- Richard Broersma Jr <rabroersma(at)yahoo(dot)com> wrote:

> > Richard, i got it to work, but i'm now banging my
> head
> > on an extension that stores pennies and converts
> to
> > dollar and cents.  anyway, i'll figure it out
> > eventually.
> 
> Do you have some sort of extention that you are
> trying to figure out the use of, or are you
> looking for an algorithm that will convert units in
> pennies to decimal dollars?
> 
> Regards,
> 
> Richard Broersma Jr.
> 

Richard, dollars_and_cents is a RoR extension that
allows one to store everything in the db as cents
(integer) and then automatically convert back to
dollars in the application itself.

the column name has to be [name]_in_cents.  i chose
price_in_cents.  the extension automatically makes
[name] available to the app, in my case price, and
formats it in monetary notation.

all i needed to do was restart my server to get it to
take effect.  i finally have it running right now.


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com

In response to

pgsql-novice by date

Next:From: operationsengineer1Date: 2006-11-26 07:04:39
Subject: Re: Data (Table) Structure Question
Previous:From: Richard Broersma JrDate: 2006-11-26 06:08:11
Subject: Re: Integer Question - Does Limit Value Make Sense

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group