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

From: Mark Stosberg <mark(at)summersault(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: function to format floats as money? (removing space padding)
Date: 2001-04-19 19:53:38
Message-ID: 3ADF4218.6604D76C@summersault.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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 price

Is that the recommended money formatting style, for amounts less than
9,999,999.99? (assuming I'll tack on my own currency symbol? ). Other
there other general styles that folks like for this? Thanks,

-mark

personal website } Summersault Website Development
http://mark.stosberg.com/ { http://www.summersault.com/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Elphick 2001-04-19 21:39:07 Re: copy into serial field with auto_increment
Previous Message Joel Burton 2001-04-19 17:16:24 Re: Postgresql to Access