How to display currency amount in words in Oracle?

Asked By 100 points N/A Posted on -
qa-featured

Is there a system function that I could use that automatically converts currency to amount in words in Oracle? Any help is greatly appreciated!

Thanks.

SHARE
Best Answer by Sharon D Mickelson
Answered By 5 points N/A #190508

How to display currency amount in words in Oracle?

qa-featured

Hello,

The code provided below will efficiently convert the currency into word formats and display with compressed style. It is used as a generator of record gathering.

Display with compressed style

It can show different types of currencies especially global currencies or traditional currencies. But several new currencies can be put in there if needed.

 Thanks.

Best Answer
Best Answer
Answered By 10 points N/A #190509

How to display currency amount in words in Oracle?

qa-featured
Here is the pseudo code for your requirement:
  1. Check if the provided input is less than 0, if so print error.
  2. Create a function with a switch case statement for printing value one to ten, eleven to nineteen and from ten, twenty to ninety.
  3. If the length of the input is two or more, and if the second digit from the left is one, print the value of the last two digits together.
  4. Else print the values of each digit.
  5. Similarly, use the above logic using length to figure out hundreds, thousands and millions. Use the functions created in step 2 to print the values.
Hope this helps!

 

Related Questions