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!

How to know if a value has more than 2 DECIMAL places.

SebaVastaJul 22 2025

In PL/SQL how to know if an amount variable which is of NUMBER type has more than 2 decimal places. Users should enter only 2 decimal places as it's an amount. But original coder forgot this and users can enter any amount of decimal places like 12.34567 etc. Values should actually have only 2 decimal places to reflect prices like 123.45 etc. If More than 2 DECIMAL places we will give an error.

How to do this in PL/SQL?

This post has been answered by Frank Kulash on Jul 22 2025
Jump to Answer
Comments
Post Details
Added on Jul 22 2025
6 comments
262 views