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!

Force conversion of a number value in pl sql to two decimal places without rounding

3353195Nov 26 2016 — edited Nov 28 2016

Need help regarding force conversion of a number value in pl sql to two decimal places.

Ex: 120.55 will remain as 120.55

      120.5 will be converted to  120.50

      120 will be converted to 120.00

The variable which stores the value is defined with datatype as Number(8,2).

The value are always restricted to two decimal places as per the datatype declared but in cases where the number value is a whole number or a number has one decimal point , the zeroes after right hand side of the decimal point are discarded. So, in those cases i want zeroes to present after decimal point till two places.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2016
Added on Nov 26 2016
20 comments
6,745 views