'Convert Integers to Dollar Format in Oracle Database
Solution 1:[1]
Solution 2:[2]
Use to_char with extended parameters format and nlsparam: TO_CHAR (number)
and Number Format Models:
You can specify currency with NLS_CURRENCY and "Group symbol" (NLS_NUMERIC_CHARACTERS('dg'))
SELECT
to_char(
value
,'L999g999'
,q'[
NLS_NUMERIC_CHARACTERS = '.,'
NLS_CURRENCY = '$'
]') AS "Valuation"
FROM estimates;
Results:
Valuation
$11,234
$104
$321,349
$2,837
NB: It's not necessary to specify extra NLS parameters if they correctly set on session level! So it will be much more agile and users will be able to use own session settings.
Solution 3:[3]
Can get rid of the left spaces if you really want that:
SQL> SELECT ltrim(to_char(value,'$999,999')) AS "Valuation" FROM estimates;
Valuation
---------
$115,508
$38,150
$92,832
$116,222
Bobby
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bob Jarvis - Слава Україні |
| Solution 2 | astentx |
| Solution 3 | Bobby Durrett |

