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

Поиск
Список
Период
Сортировка
От Mark Stosberg
Тема Re: function to format floats as money? (removing space padding)
Дата
Msg-id 3ADF4218.6604D76C@summersault.com
обсуждение исходный текст
Ответ на Re: function to format floats as money?  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: function to format floats as money? (removing space padding)  (Karel Zak <zakkr@zf.jcu.cz>)
Список 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/


В списке pgsql-sql по дате отправления:

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: Postgresql to Access
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: copy into serial field with auto_increment