Swadhin Ray
asked on
Round functino in oracle
Hello experts,
I have created a table like below:
SQL> create table gunti (col1 number) ;
And inserted one record as below:
SQL> insert into gunti values('-2.100579941275756 4E16') ;
SQL> commit;
I want to round the value like -2.10
I have created a table like below:
SQL> create table gunti (col1 number) ;
And inserted one record as below:
SQL> insert into gunti values('-2.100579941275756
SQL> commit;
I want to round the value like -2.10
I just noticed the scientific notation in the 'string'. That appears to cause a problem.
Let me see what I can find.
Let me see what I can find.
Now that I've played with this a little, I'm not following the question.
-2.1005799412757564E16 equates to -21005799412757564
How do you expect to get -2.10?
-2.1005799412757564E16 equates to -21005799412757564
How do you expect to get -2.10?
ASKER
@slightwv :
can you please explain me more on your comment ?
can you please explain me more on your comment ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you tell me the calculation for conversion based on my input?
How to find the exact conversion numbers for such input like mine.
As far as looked into the logic the notation should be on bases of 10.
How to find the exact conversion numbers for such input like mine.
As far as looked into the logic the notation should be on bases of 10.
I'm not understanding what you want/need to do with the number.
To display the number in it's complete form in sqlplus just use: set numwidth 20
Below is an example
To display the number in it's complete form in sqlplus just use: set numwidth 20
Below is an example
SQL> drop table gunti purge;
Table dropped.
SQL> create table gunti (col1 number) ;
Table created.
SQL> insert into gunti values('-2.1005799412757564E16') ;
1 row created.
SQL> commit;
Commit complete.
SQL> set numwidth 20
SQL> select col1 from gunti;
COL1
--------------------
-21005799412757564
SQL>
ASKER
Thanks .. for detail explanation ...
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions155.htm#SQLRF00698
select round(col1,2) from gunti;