Reputation: 7
declare
a number
begin
a:=10000
dbms_put_line(a)
end:
I want to get my output as 10,000.Please help Thanks in advance
Upvotes: 0
Views: 84
Reputation: 2410
You can do it this way.
begin
DBMS_OUTPUT.put_line(to_char(a,'99,99,99,999')) ;
end;
Upvotes: 0
Reputation: 665
Try this:
select rtrim(to_char(10000, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS=''.,'''), '.') from dual
the optional third NLS argument to the to_char() function to set the G and D
Upvotes: 2