Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing numbers in millions

Status
Not open for further replies.

thessa

Programmer
Jun 18, 2001
21
IT
Ok, folks, I realize this MUST be an easy one, but I'm not figuring it out! I need to show a number field in millions only. For example, if the normal, non-formatted results are
8,908,999
39,999,897
438,000
7,890
I want to see
8
39
.43
.0079
Anyone know the format mask for that?
Thanks!
Thessa
 
Just divide the number you want by a million. You can use the round function on the result.

Ex:
1* select round((39500001/1000000),2) from dual
SQL> /

ROUND((39500001/1000000),2)
---------------------------
39.5
 
Oh excellent, thanks for the speedy reply!

Thessa
 
Actually, it looks like you want to use TRUNC(your_value/1000000). Using ROUND, 8,908,999 evaluates to 9 instead of 8. TRUNC will give you 8.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top