I'm on Brazil, and our currency format is something like 'R$ 9.999,00'.
I'm trying to select a field, and change the format of the return. However, it seems I can't do it. I've tried:
ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ',.';
and
SELECT to_char(10,'9,999.00', 'NLS_NUMERIC_CHARACTERS = '',.''') FROM DUAL
None of those worked. Not sure if it might be my client (I'm on Ubuntu using sqldeveloper), or if I'm doing something wrong.
Any ideas?
SQL Fiddle Demo You can first replace thousand separator comma(,) to a Zero length string (''), and then you can replace Decimal('. ') to comma(',') in the same select statement.
Use
SELECT to_char(10,'9G990D00', 'NLS_NUMERIC_CHARACTERS = '',.''') FROM DUAL
G is symbol for thousands separator D is for decimal separator
I think that your format mask is wrong.Please try this format mask:
SELECT to_char(10000,'99G990D00', 'NLS_NUMERIC_CHARACTERS = '',.''') FROM DUAL
make sure you will use correct number of leading '9' in format mask for bigger numbers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With