Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Add trailing zeros dynamically

Yann39Sep 17 2010 — edited Sep 17 2010
Hi,

I use Oracle 10g.

I have a query like :
select
	round(col_cumul,:USER_NUMBER_PRECISON) as "Dist. cumul."
from
	my_table
where :USER_NUMBER_PRECISON is a variable representing the number of decimal the user wants to show.

For exemple, when :USER_NUMBER_PRECISON = 3, it can returns :

1258.8
105.526
2458.35
122

and I want:

1258.800
105.526
2458.350
122.000

I found this page : http://www.oradev.com/oracle_number_format.jsp

But I can't make it works as my number of decimals can change depending of the user choice (:USER_NUMBER_PRECISON variable).

Any help would be appreciated.

Thanks.

Yann.
This post has been answered by hm on Sep 17 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2010
Added on Sep 17 2010
8 comments
8,562 views