Home » SQL & PL/SQL » SQL & PL/SQL » Number format (help required in SQL)
icon4.gif  Number format [message #379063] Sun, 04 January 2009 05:52 Go to next message
shadab.biotech
Messages: 2
Registered: January 2009
Junior Member
Hi
I need to convert the number in decimal separated format.
ie if 10,000.00 is input the converted number would be
10.000,00

Thanks & Regards
Shadab
Re: Number format [message #379065 is a reply to message #379063] Sun, 04 January 2009 06:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
TO_CHAR
Number Format Models
NLS_NUMERIC_CHARACTERS

Regards
Michel

Re: Number format [message #379066 is a reply to message #379063] Sun, 04 January 2009 06:21 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8631
Registered: November 2002
Location: California, USA
Senior Member
Numbers are not stored in any format. They can be displayed in various ways, as shown below.

SCOTT@orcl_11g> CREATE TABLE test_tab
  2    (test_col  NUMBER)
  3  /

Table created.

SCOTT@orcl_11g> INSERT INTO test_tab VALUES (10000)
  2  /

1 row created.

SCOTT@orcl_11g> SELECT test_col
  2  FROM   test_tab
  3  /

  TEST_COL
----------
     10000

SCOTT@orcl_11g> SELECT TO_CHAR
  2  	      (test_col,
  3  	       '99G999D99')
  4  FROM   test_tab
  5  /

TO_CHAR(TE
----------
 10,000.00

SCOTT@orcl_11g> SELECT TO_CHAR
  2  	      (test_col,
  3  	       '99G999D99',
  4  	       'NLS_NUMERIC_CHARACTERS = '',.''')
  5  FROM   test_tab
  6  /

TO_CHAR(TE
----------
 10.000,00

SCOTT@orcl_11g> 

Re: Number format [message #379074 is a reply to message #379066] Sun, 04 January 2009 08:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
All of this (but the very first sentence) can easily be learned from the 3 links I posted.

Regards
Michel
Re: Number format [message #379098 is a reply to message #379074] Sun, 04 January 2009 19:39 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
That's a bit unneccessary.

With a 7 minute difference in posting time, I think Barbara probably deserves the benefit of the doubt; there is a fair likelihood that there was no response at the time she composed her post.
Re: Number format [message #379125 is a reply to message #379098] Mon, 05 January 2009 00:30 Go to previous messageGo to next message
Michel Cadot
Messages: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
My sincere apologies, I didn't see the time.

Regards
Michel
Re: Number format [message #379160 is a reply to message #379125] Mon, 05 January 2009 03:20 Go to previous message
Littlefoot
Messages: 20893
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Right; 7 minutes and 9000 kilometers. Be patient, Michel! ./fa/917/0/
Previous Topic: Delete small expiry date against pcode
Next Topic: funcation date (-)
Goto Forum:
  


Current Time: Mon Dec 05 06:55:03 CST 2016

Total time taken to generate the page: 0.28254 seconds