# Thread: Dividing the number by 100

1. Registered User
Join Date
Mar 2012
Posts
37

## Unanswered: Dividing the number by 100

Is it possible in oracle that when i give the number
lets say 345 it should give the result by 3.45(means it should divide the number by 100 at back end)
I should not do it manually. I just give the number and it should give me the result.

like select 223 from dual
when it execute this statement it should give me 2.23

2. Registered User
Join Date
Nov 2003
Posts
2,974
what's wrong with
Code:
`select 223 / 100 from dual`

3. Registered User
Join Date
Mar 2012
Posts
37
I have the constraint. because i have to read the source file..
Some type of conversion if there possible

4. Lost Boy
Join Date
Jan 2004
Location
Croatia, Europe
Posts
4,110
Or create a function (but that's really an overkill here):
Code:
```SQL> create or replace function f_div_by_100 (par_num in number)
2    return number
3  is
4  begin
5    return (par_num / 100);
6  end;
7  /

Function created.

SQL> select f_div_by_100(223) from dual;

F_DIV_BY_100(223)
-----------------
2,23

SQL>```

5. Registered User
Join Date
Mar 2012
Posts
37
Any internal Conversion is not there. like we do normally
number to varchar, date etc.

6. Registered User
Join Date
Mar 2007
Posts
626
Just to paraphrase your question:

Is it possible in calculator that when i give the number
lets say 345 it should give the result by 3.45(means it should divide the number by 100 at back end)
I should not do it manually. I just give the number and it should give me the result.

like typing 223 on its buttons
when it processes these strokes it should display me 2.23

Now seriously: what problem are you really trying to solve?

7. Registered User
Join Date
Oct 2002
Location
Cape Town, South Africa
Posts
253
Originally Posted by goodman2253
Any internal Conversion is not there. like we do normally
number to varchar, date etc.
The concept I think you are referring to is the NLS environment which implicitly convert the formatting of values when outputting to text.

And no, there is no number format setting like there is for dates. You can only change the decimal and group characters. But you can't change two hundred and twenty three into 2,23.
See the Orale documentation on Setting Up an NLS Environment.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•