How to handle "currency" in Vertica
Moderator: NorbertKrupa
-
- Intermediate
- Posts: 163
- Joined: Tue Jun 19, 2012 2:44 pm
- Location: Rio de Janeiro
- Contact:
Re: How to handle "currency" in Vertica
Thank you "SKWA" and "SCUTTER" for the effort in helping me !!
trying so hard !!!
Re: How to handle "currency" in Vertica
Hi!
>> shouldn't this be already in Vertica by default ?
May be, but take in account that main goal of Vertica is analytics and NOT! data representation. Data should be represented by BI tools and them must have such ability.
>> shouldn't this be already in Vertica by default ?
May be, but take in account that main goal of Vertica is analytics and NOT! data representation. Data should be represented by BI tools and them must have such ability.
Re: How to handle "currency" in Vertica
Could you use the translate function when you want to display the data?
Code: Select all
dbadmin=> SELECT translate(to_char(123456.77,'R$ 999G999G999D99'), ',.', '.,');
translate
--------------------
R$ 123.456,77
(1 row)
Have a GREAT day!
-
- Intermediate
- Posts: 163
- Joined: Tue Jun 19, 2012 2:44 pm
- Location: Rio de Janeiro
- Contact:
-
- Intermediate
- Posts: 163
- Joined: Tue Jun 19, 2012 2:44 pm
- Location: Rio de Janeiro
- Contact:
Re: How to handle "currency" in Vertica
Even a better solution is :
Set the locale: (if more than one node, set this in the .profile, .bashrc of the dbadmin user, or just set it as the system wide locale)
Thank you Carlos,
PS more detailes on this on page "Set the Host Locale (Language)" in the online documentation at vertica site !!
How could i miss this !! OMG
Set the locale: (if more than one node, set this in the .profile, .bashrc of the dbadmin user, or just set it as the system wide locale)
Code: Select all
export LC_ALL=pt_BR.UTF-8
Start Vertica.
On vsql:
dbadmin=> SELECT TO_CHAR(12343148.56, 'L999G999G999G999D99');
TO_CHAR
---------------------------
R$ 12.343.148,56
(1 row)
PS more detailes on this on page "Set the Host Locale (Language)" in the online documentation at vertica site !!
How could i miss this !! OMG
trying so hard !!!
Re: How to handle "currency" in Vertica
Glad you resolved this. I thought you were trying to convert between mulitple currencies, not just display in a single local currency.
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC
Vertica Consultant, Zazz Technologies LLC
-
- Intermediate
- Posts: 163
- Joined: Tue Jun 19, 2012 2:44 pm
- Location: Rio de Janeiro
- Contact:
Re: How to handle "currency" in Vertica
I think i need to improve the way i put things in English .scutter wrote:Glad you resolved this. I thought you were trying to convert between mulitple currencies, not just display in a single local currency.
Thx ALL
trying so hard !!!