Re: [SQL] function to format floats as money? (removing space padding)

2001-04-20 Thread Karel Zak
On Thu, Apr 19, 2001 at 02:53:38PM -0500, Mark Stosberg wrote: > > Now that I've figured out that numeric is good for storing money, and > that I can format with like this: > > to_char(price, '9,999,999.99') as price > > Then I discovered that sometimes this returns leading spaces I don't > wan

Re: [SQL] function to format floats as money? (removing space padding)

2001-04-19 Thread Mark Stosberg
Now that I've figured out that numeric is good for storing money, and that I can format with like this: to_char(price, '9,999,999.99') as price Then I discovered that sometimes this returns leading spaces I don't want. I can get rid of them like this: trim(to_char(price, '9,999,999.99')) as pr

Re: [SQL] function to format floats as money?

2001-04-17 Thread John Hasler
I wrote: > Floats are fine for money as long as you only add and subtract and don't > deal in amounts that won't fit in the mantissa. Ross writes: > Or you're writing software in Germany (all of the EU now?) that _might_ get > used in an offical capacity. I was referring to what actually works,

Re: [SQL] function to format floats as money?

2001-04-17 Thread Ross J. Reedstrom
On Tue, Apr 17, 2001 at 01:52:16PM -0500, John Hasler wrote: > Ross writes: > > But seriously, numeric(10,2) (or whatever precision and scale is correct > > for your application) is the standard answer. > > Floats are fine for money as long as you only add and subtract and don't > deal in amounts

Re: [SQL] function to format floats as money?

2001-04-17 Thread John Hasler
Ross writes: > But seriously, numeric(10,2) (or whatever precision and scale is correct > for your application) is the standard answer. Floats are fine for money as long as you only add and subtract and don't deal in amounts that won't fit in the mantissa. -- John Hasler [EMAIL PROTECTED] (John

Re: [SQL] function to format floats as money?

2001-04-17 Thread Ross J. Reedstrom
On Tue, Apr 17, 2001 at 10:31:49AM -0500, Mark Stosberg wrote: > Peter Eisentraut wrote: > > > > Mark Stosberg writes: > > > > > I'm curious to know if there is a function available in Postgres 7.0.3 > > > (or 7.1) that will format a float style number as "money". I understand > > > that the m

Re: [SQL] function to format floats as money?

2001-04-17 Thread Mark Stosberg
Peter Eisentraut wrote: > > Mark Stosberg writes: > > > I'm curious to know if there is a function available in Postgres 7.0.3 > > (or 7.1) that will format a float style number as "money". I understand > > that the money type is going away in the future, so using a float type > > that is some

Re: [SQL] function to format floats as money?

2001-04-17 Thread Peter Eisentraut
Mark Stosberg writes: > I'm curious to know if there is a function available in Postgres 7.0.3 > (or 7.1) that will format a float style number as "money". I understand > that the money type is going away in the future, so using a float type > that is sometimes formatted like money seems like a

[SQL] function to format floats as money?

2001-04-17 Thread Mark Stosberg
Hello, I'm curious to know if there is a function available in Postgres 7.0.3 (or 7.1) that will format a float style number as "money". I understand that the money type is going away in the future, so using a float type that is sometimes formatted like money seems like a good alternative. So